I was wondering if there's a simple method from the command line of doing this.
If I have, for example a file (test.txt) containing 3 lines:
a
b
c
I wish to search for the second line, but return whatever is on the line after what I have searched on.
I can do the grep b test.txt...naturally this will return the 2nd line to the prompt, I wish to however get the third line instead of the one which was grep'd for.
Defo possible in Perl, however I'm wondering if there's any simpler way of doing this from the command line, or even something in awk? %-)
Thanks a bunch for your thoughts/comments.
If I have, for example a file (test.txt) containing 3 lines:
a
b
c
I wish to search for the second line, but return whatever is on the line after what I have searched on.
I can do the grep b test.txt...naturally this will return the 2nd line to the prompt, I wish to however get the third line instead of the one which was grep'd for.
Defo possible in Perl, however I'm wondering if there's any simpler way of doing this from the command line, or even something in awk? %-)
Thanks a bunch for your thoughts/comments.