Sponsored Content
Top Forums Shell Programming and Scripting Delete Blank Lines Between DHCP Host Blocks Post 302258746 by radoulov on Saturday 15th of November 2008 06:12:52 PM
Old 11-15-2008
If Perl is acceptable:

Code:
perl -i~ -ne'print if /{/../}/' dhcpd.conf

You may try the same with sed but you need an implementation that supports the i option:

Code:
sed -i~ -n '/{/,/}/p' dhcpd.conf

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

delete blank lines or lines with spaces only

hi there i'm trying to delete blank lines and or lines with spaces only from a series of files in an directory. to do so, i'm using this: for files in `ls /users/myname/pesop* 2>/dev/null` do grep -v ^$ $files > newfile mv newfile $files done now, this works great for blank lines but... (3 Replies)
Discussion started by: vascobrito
3 Replies

2. Shell Programming and Scripting

delete blank lines with sed

I have a text file with blank lines fullfilled with spaces and others only containing the "Enter" caracter, the \012. I would like to eliminate all them with the sed command. Is it possible? making: sed '/^$/d' <file should delete the blank lines but doesn't work for the lines that only... (2 Replies)
Discussion started by: tmxps
2 Replies

3. UNIX for Dummies Questions & Answers

delete blank lines from a file

can anyone show me how to delete blank lines from a file. thanks in advance (2 Replies)
Discussion started by: sachin.gangadha
2 Replies

4. Shell Programming and Scripting

Delete blocks of lines from text file

Hello, Hello Firends, I have file like below. I want to remove selected blocks say abc,pqr,lst. how can i remove those blocks from file. zone abc { blah blah blah } zone xyz { blah blah blah } zone pqr { blah blah blah } (4 Replies)
Discussion started by: nrbhole
4 Replies

5. UNIX for Dummies Questions & Answers

delete traling blank lines only

Hi, I have blank line in the file, I just want to remove trailing blank lines. There are some blank lines between the lines, i don't want remove those. Just want to delete blank lines at the end. I used this command sed '/^$/d' infile > outfile, but it is not removing anything. I think... (1 Reply)
Discussion started by: visu
1 Replies

6. Shell Programming and Scripting

Why cant i delete blank lines?

I have a sed pipeline: myVar=$(cat $FILE | sed -n '/regex/,/regex/{/regex/d;p}' | sed -n '/regex/!p' | sed -e s/*:// | sed /regex/,+8d \ ) sed '/^$/d' sed '/./!d' And i've tried to add that in a different order rather then just on the end..Why isnt it deleting all the blank... (2 Replies)
Discussion started by: omgsomuchppl
2 Replies

7. Shell Programming and Scripting

Delete blank lines from a file

Hi, I want to use diff to compare two files in a Perl file. But one of the files has some blank lines at the end. So I want to delete the blank lines from the file firstly and then use diff to compare them. But I dont know how to delete the blank lines from the files. Meanwhile, the system is... (5 Replies)
Discussion started by: Damon_Qu
5 Replies

8. Shell Programming and Scripting

Delete blank lines, if blank lines are more than one using shell

Hi, Consider a file named "testfile" The contents of file are as below first line added for test second line added for test third line added for test fourth line added for test fifth line added for test (5 Replies)
Discussion started by: anil8103
5 Replies

9. UNIX for Advanced & Expert Users

Delete blank spaces and blank lines in a file

Hi Gurus, Somebody can say me how to delete blank spaces and blank lines in a file unix, please. Thank you for advanced. (10 Replies)
Discussion started by: systemoper
10 Replies

10. UNIX for Beginners Questions & Answers

Delete multiple lines between blank lines containing two patterns

Hi all, I'm looking for a way (sed or awk) to delete multiple lines between blank lines containing two patterns ex: user: alpha parameter_1 = 15 parameter_2 = 1 parameter_3 = 0 user: alpha parameter_1 = 15 parameter_2 = 1 parameter_3 = 0 user: alpha parameter_1 = 16... (3 Replies)
Discussion started by: ce9888
3 Replies
OCF_HEARTBEAT_DHCPD(7)						OCF resource agents					    OCF_HEARTBEAT_DHCPD(7)

NAME
ocf_heartbeat_dhcpd - Chrooted ISC DHCP server resource agent. SYNOPSIS
dhcpd [start | stop | monitor | meta-data | validate-all] DESCRIPTION
Manage an ISC DHCP server service in a chroot environment. SUPPORTED PARAMETERS
config The absolute path to the DHCP server configuration file. (unique, required, string, no default) chrooted Configure the dhcpd service to run in a chrooted or non-chrooted mode. (unique, optional, boolean, default true) chrooted_path The absolute path of the chrooted DHCP environment. (unique, optional, string, default "/var/lib/dhcp") binary The binary for the DHCP server process. An absolute path definition is not required, but can be used to override environment path. (optional, string, default "dhcpd") user The system user the DHCP server process will run as when it is chrooted. (optional, string, default "dhcpd") group The system group the DHCP server process will run as when it is chrooted. (optional, string, default "nogroup") interface The network interface(s) the DHCP server process will bind to. A blank value will bind the process to all interfaces. (optional, string, no default) includes This parameter provides a means to copy include files into the chrooted environment. If a dhcpd.conf file contains a line similar to this: include "/etc/named.keys"; Then an admin also has to tell the dhcpd RA that this file should be pulled into the chrooted environment. This is a space delimited list. (optional, string, no default) leases The leases database file, relative to chrooted_path. (optional, string, default "/db/dhcpd.leases") pid The path and filename of the PID file. It is relative to chrooted_path. (optional, string, default "/var/run/dhcpd.pid") SUPPORTED ACTIONS
This resource agent supports the following actions (operations): start Starts the resource. Suggested minimum timeout: 20. stop Stops the resource. Suggested minimum timeout: 20. monitor Performs a detailed status check. Suggested minimum timeout: 20. Suggested interval: 10. meta-data Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5. validate-all Performs a validation of the resource configuration. Suggested minimum timeout: 20. EXAMPLE
The following is an example configuration for a dhcpd resource using the crm(8) shell: primitive p_dhcpd ocf:heartbeat:dhcpd params config=string op monitor timeout="20" interval="10" depth="0" SEE ALSO
http://www.linux-ha.org/wiki/dhcpd_(resource_agent) AUTHOR
Linux-HA contributors (see the resource agent source for information about individual authors) resource-agents UNKNOWN 06/09/2014 OCF_HEARTBEAT_DHCPD(7)
All times are GMT -4. The time now is 03:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy