06-03-2014 04:32 PM - last edited on 06-05-2014 02:22 AM by Maiko-I
I have a large files, and some lines include a keyword that I am looking for. Further, I wanted to list next 3 lines following the line that includes the keywork.
Thank you very much for your help!
P.S. This thread has been moved from HP-UX > System Administration o HP-UX > languages. - Hp Forum Moderator
Solved! Go to Solution.
06-05-2014 05:29 AM
In case your site doesn't allow open source software outside of hp.com, you can use awk:
where pattern is whatever keyword(s) you are looking for, and filename is the name of the file.
06-06-2014 02:33 AM
>In case your site doesn't allow open source software
If you like cryptic commands you can use sed:
sed -e '
n; n; n; p
Note: sed uses REs and awk uses EREs.