![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| deleting lines from multiple text files | vrms | Shell Programming and Scripting | 3 | 04-25-2008 11:01 AM |
| retrieved multiple lines on multiple places in a file | dala | Shell Programming and Scripting | 8 | 03-14-2008 03:28 PM |
| deleting lines using awk-best way? | satnamx | Shell Programming and Scripting | 3 | 08-29-2007 07:24 PM |
| deleting lines | ajnabi | Shell Programming and Scripting | 8 | 05-02-2003 11:50 AM |
| deleting lines | supercbw | High Level Programming | 1 | 05-06-2002 12:53 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Deleting Multiple Lines with sed
I am trying to use sed to delete multiple lines in a file. The problem is that I need to search for a certain line and then once found delete it plus the next 4 lines. For instance if I had a file that consisted of the following lines:
#Data1.start ( (Database= data1) (Name = IPC) (Description = ) ) #Data2.start ( (Database= data2) (Name = IPC) (Description = ) ) #Data3.start ( (Database= data3) (Name = IPC) (Description = ) ) I need to be able to sed the file and delete the line starting with #Data2.start plus the next four lines. Can anyone please give me the correct syntax to do this? ![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|