I need to find a line but need to print the line above it.
ie) consider a file containing
$cat > para returns between the paragaraphs
italic or bold
quotes by placing
italic
Here i need to find for italic, and i need to get the output as below
returns between the paragaraphs
quotes by placing
I tried using
- cat para|grep -B1 italic it giving an output as
returns between the paragaraphs
italic or bold
quotes by placing
italic
- cat para|grep -B1 italic |head -1 it giving an output as
returns between the paragaraphs
- i have tried combination of grep and cat
cat >last
cat para|grep -B1 italic >last
cat last|grep -v italic
Now i'm getting the right output
returns between the paragaraphs
quotes by placing
Now my question is there any other way to get the same output ??? Please help me on this guys...