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



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
Configuring snmpd.conf and snmptrapd.conf jagdish.machhi@ UNIX for Advanced & Expert Users 2 04-17-2008 03:01 PM
newsyslog.conf mirusnet UNIX for Advanced & Expert Users 1 02-24-2008 11:11 AM
how to delete entry in file "wtmpx"(/var/adm/wtmpx) arm_naja UNIX for Advanced & Expert Users 4 03-08-2006 04:00 AM
dhcpd.conf keliy1 Linux 1 11-17-2004 04:05 PM
dns and resolv.conf b03der UNIX for Dummies Questions & Answers 10 07-26-2002 04:34 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #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?
  #2 (permalink)  
Old 11-21-2007
Franklin52 Franklin52 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,212
Code:
sed '/host bar {/,/}/d' /etc/dhcpd.conf
Regards
  #3 (permalink)  
Old 11-26-2007
tizatron tizatron is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 2
Many thanks.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 08:41 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0