So I am trying to grep for a specific pattern and then print everything above and below that pattern up to a specific indicator. I don't know if this is possible with grep or if I should you some other tool like awk, sed, or generate some shell script. So if I have the following:
---------------
.....
process: failed
......
----------------
and
----------------
.....
process: frozen
.....
----------------
I want to grep for 'process: frozen' and want everything between the dashed lines when 'process: frozen' is found. However the number of lines between the dashed lines may vary for different 'process: frozen' messages, so I can't count the number of lines above or below and use the -A and -B option of grep. Thank you in advance.