[NCLUG] sed help ?

Michael Milligan milli at acmeps.com
Fri Feb 28 18:19:00 MST 2003


Gabriel L. Somlo wrote:
> Hi !
> 
> The command
> 
> 	cat foo | sed -e '/some pattern/d'  > bar
> 
> will delete all lines containing 'some pattern' from foo;
> 
> Do you guys know how I could delete the line containing 'some pattern'
> *and the line immediately following it* (regardless of content) ?
> 

cat foo | sed -e '/some pattern/,+1d' > bar

Regards,
Mike

-- 
Michael Milligan  --  Free Agent  --  milli at acmeps.com




More information about the NCLUG mailing list