There is a command which gives me a long output. I want to just extract one line of it. This line changes, but the two lines before the desired line are always the same. How can I extract this line only by searching for the previous line(s): The command output example is like:
foo-bar blahblah
===============
foo bar foo bar foo bar.
this string is always the same (search string)
===============
the desired line is here
==========
foofoofoo
==========
I already tried
awk '/this string is always the same/{p=1} NF{out=$2} END{if(p==1){print out}}'
and without the if part but it doesn't work
I would need the result to be like:
the desired line is here