The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 11-21-2007
tizatron tizatron is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 2
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
}
I was trying to use a label like:

Code:
 sed -e :a -e "s/^host bar {[^}]*//g;/{/N;//ba" /etc/dhcpd.conf
I want to delete every from "host bar" to the "}".

Any thoughts?