in reply to perl one line for advanced grep (current line and next one)
perl -ne 'print $_.=<> if /string/' testfile
Nice, but it misses the line following a second consecutive line matching the pattern
# eg this works as expected
# this one fails to print test2
Frying pan on the stove
Results (364 votes). Check out past polls.