1756563 Members
1958 Online
108848 Solutions
New Discussion юеВ

Re: SED question???

 
SOLVED
Go to solution
Alan Meyer_4
Respected Contributor

SED question???

I found the following syntax on the internet to get sed to print the line AFTER the regexp

sed -n '/regexp/{n;p;}'

How do I change it to print the 2 lines following the regexp?

Many thanks...

-a
" I may not be certified, but I am certifiable... "
2 REPLIES 2
James R. Ferguson
Acclaimed Contributor
Solution

Re: SED question???

Hi Alan:

# sed -n '/regexp/{n;p;n;p;}'

Regards!

...JRF...
Alan Meyer_4
Respected Contributor

Re: SED question???

you're awesome JRF, thanks
" I may not be certified, but I am certifiable... "