Here is my humble variation:
perl -ne "print if /error/ || $last=~/error/; $last=$_;" test_log.txt
In reply to Re: perl one line for advanced grep (current line and next one)
by hdb
in thread perl one line for advanced grep (current line and next one)
by sroux
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |