I want to grep some line from a log file with an input from another file. I'm using this small command to do that:
while read line; do grep "$line" service.log; done < input_strings.txt > result.txt
input_strings.txt has like 50 000 strings (one per line). For every of this string I'm currently searching the huge
service.log file (with around 2 000 000 lines).
So lets say the 1st string of
input_strings.txt is found in
service.log at line 10 000, this line gets written to my
result.txt. After that, the 2nd string of
input_strings.txt will be searched in
service.log, BUT starting at line 1 of
How can I remember the last line I found the 1st entry in
service.log? So that I can start the 2nd search-run there?