I was looking for a way to print 10 lines above a regexp
grep -B works
but it doesnt on my SunOS's
I was looking for a sed alternative or an awk or maybe perl
Quote:
sed -n '/regexp/{g;1!p;};h' filename.txt
|
The above code just prints 1 line above the regexp. How do I print 10 lines or maybe 15?