grep all lines from start of file to line containing a string -
if have input file containing
statementes asda rertte nothing here
i want grep / extract (without using awk) every line starting till string "something". how can this? grep -b not work since needs exact number of lines.
desired output:
statementes asda rertte
it's not robust, sure -b works... make -b count huge:
grep -b `wc -l <filename>` -e 'something' <filename>
Comments
Post a Comment