![]() |
|
|
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 |
| Find and delete the line | gsusarla | UNIX for Advanced & Expert Users | 8 | 07-09-2008 05:15 PM |
| Find a word and delete the line | gsusarla | UNIX for Dummies Questions & Answers | 1 | 04-02-2008 03:45 PM |
| sed - Replace Line which contains the Pattern match with a new line | kousikan | Shell Programming and Scripting | 2 | 03-24-2007 07:24 AM |
| SED: match pattern & delete matched lines | not4google | Shell Programming and Scripting | 7 | 11-22-2006 09:58 AM |
| How to delete lines do NOT match a pattern | JumboGeng | UNIX for Dummies Questions & Answers | 1 | 09-20-2006 06:52 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
sed: find match and delete the line above
I am searching a dhcpd.conf to find the hardware ethernet match, then once the match is found delete just the line above it. For example:
testmachine.example { hardware ethernet 00:00:00:00:00:00; fixed address 192.168.1.100; next-server 192.168.1.101; filename "linux-install/pxelinux.0"; } I would like to use sed to remove "testmachine.example {". I was going to create a two step process by removing the line above the harware ethernet match. Then remove the hardware ethernet match through }. However, if someone knows how to find the harware ethernet match and remove the whole block, I would be very appreciative. There are multiple fixed addresses in this file, so it can only remove this block based on the hardware ethernet match. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|