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
Electric eels were invented at the same time as electricity
Before electricity was invented, electric eels had to stun with gas
Results (363 votes). Check out past polls.