![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Configuring snmpd.conf and snmptrapd.conf | jagdish.machhi@ | UNIX for Advanced & Expert Users | 2 | 04-17-2008 12:01 PM |
| newsyslog.conf | mirusnet | UNIX for Advanced & Expert Users | 1 | 02-24-2008 08:11 AM |
| how to delete entry in file "wtmpx"(/var/adm/wtmpx) | arm_naja | UNIX for Advanced & Expert Users | 4 | 03-08-2006 01:00 AM |
| dhcpd.conf | keliy1 | Linux | 1 | 11-17-2004 01:05 PM |
| dns and resolv.conf | b03der | UNIX for Dummies Questions & Answers | 10 | 07-26-2002 01:34 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
delete dhcp.conf entry using sed
I am trying to use sed to remove entries from my dhcpd.conf file.
The form of the file is: Code:
host foo {
option 1
option 2
}
host bar {
option 1
option 2
}
Code:
sed -e :a -e "s/^host bar {[^}]*//g;/{/N;//ba" /etc/dhcpd.conf
Any thoughts? |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Code:
sed '/host bar {/,/}/d' /etc/dhcpd.conf
|
|
#3
|
|||
|
|||
|
Many thanks.
|
|||
| Google The UNIX and Linux Forums |