DaemonForums  

Go Back   DaemonForums > Miscellaneous > Programming

Programming C, bash, Python, Perl, PHP, Java, you name it.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   (View Single Post)  
Old 24th June 2008
c0mrade's Avatar
c0mrade c0mrade is offline
Port Guard
 
Join Date: May 2008
Posts: 41
Thanked 0 Times in 0 Posts
Default Find pattern in a file and erase it

Hello,

I'd like to find pattern in a file and erase line containing that pattern and 2 lines below that pattern. I know how to find pattern with grep -r pattern and erase line containing that pattern, but can't figure out the rest, how to erase 2 lines below that pattern line. Any suggestions?

Thank you in advance
Reply With Quote
 

Tags
sed

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP read file contents - Maximum file size cksraj Programming 1 21st September 2009 11:38 AM
K3b cannot find growisofs maxrussell FreeBSD General 5 26th April 2009 12:20 PM
Command to find and replace, but not creating a new file 18Googol2 Programming 4 22nd September 2008 10:28 PM
pkg_add g95;g95 x.f95: cannot find g95 enpey OpenBSD Packages and Ports 8 27th August 2008 12:48 AM
where might I find 'libcamel'? Damien787 FreeBSD Ports and Packages 16 17th June 2008 11:35 PM


All times are GMT. The time now is 11:00 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick