I've spent some time searching the web, but didn't find the answer. Let's say I have a file containing the following lines :
aaaaaaa
vvvvv
ggggg
yyyyyyyyy
ffffff
rrrrrrrr
uuuuu
ssssssssssss
zzzzz
hhhhhhhh
I know how to find all lines from the one containing "ffffff" to the one containing "uuuuu" using awk :
awk '/ffffff/,/uuuuu/' file
But how can I get also the line preceding the first one I found (i.e. "yyyyyyyyy")? Is there something like grep -B 1 to do this? What I want to get is :
yyyyyyyyy
ffffff
rrrrrrrr
uuuuu
Thanks in advance.