I am writing a shell script that is looking for certain strings in a text file. It works well and gets exactly what I need.
However, the way the program writes to the text file, it puts the timestamp in a line above the string I am looking for and the path below the string I am looking for.
So my question is, how do I grab all three lines in my search? I am thinking I might need to go to something more powerful like awk.
In the basic implementations of grep, not without putting a lot of shell script round it. In newer version of grep, there's a commandline parameter to display a set number of lines before and after each match. man grep for more info and to see if you have the right version.