in reply to How can I print three lines before pattern match?
Do you have to use Perl?
Of course it has to be Perl! ;-)
Of course it has to be Perl! ;-)
Otherwise grep will do it:
grep -B3 pattern logfile
In Section
Seekers of Perl Wisdom
in reply to How can I print three lines before pattern match?
Otherwise grep will do it:
grep -B3 pattern logfile