Sponsored Content
Top Forums Shell Programming and Scripting How to delete lines using sed? Post 302508124 by tkmmelvin on Saturday 26th of March 2011 03:14:32 AM
Old 03-26-2011
How to delete lines using sed?

<VirtualHost 192.168.1.158:80>
DocumentRoot /home/ten
ServerName ten.com
</VirtualHost>

<VirtualHost 192.168.1.158:80>
DocumentRoot /home/sachin
ServerName sachin.com
</VirtualHost>

<VirtualHost 192.168.1.158:80>
DocumentRoot /home/yuvraj
ServerName yuvraj.com
</VirtualHost>

<VirtualHost 192.168.1.158:80>
DocumentRoot /home/checking
ServerName checking.com
</VirtualHost
~

I want to delete sachin.com from the above file so the output look like

<VirtualHost 192.168.1.158:80>
DocumentRoot /home/ten
ServerName ten.com
</VirtualHost>

<VirtualHost 192.168.1.158:80>
DocumentRoot /home/yuvraj
ServerName yuvraj.com
</VirtualHost>

<VirtualHost 192.168.1.158:80>
DocumentRoot /home/checking
ServerName checking.com
</VirtualHost
~
Please how to do this using sed command
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Delete multiple lines w/ sed

Hi all, I am trying to figure out the syntx to delete multiple lines w/ sed. I know the following syntax will delete lines 1 THROUGH 5 from filex: sed 1,5d filex But I wan to delete lines 1 AND 5 (keeping lines 2,3, and 4). Does anyone know how to do this in a single sed statement? ... (2 Replies)
Discussion started by: bookoo
2 Replies

2. Shell Programming and Scripting

sed help - delete last 2 lines.

I have been reading through the sed one liners, trying to understand what is happening. # delete the last 2 lines of a file sed 'N;$!P;$!D;$d' The above will delete the last 2 line of a file. I tried analyzing what happens. And I got lost :( This is what I understood so far from the... (2 Replies)
Discussion started by: vino
2 Replies

3. Shell Programming and Scripting

Delete lines containing text with sed

hello all I have bunch of files containing lines of text that surrounding by <# .......#> tags I like to delete this lines from the text files whiteout open the files , can it be done with sed ? or other unix tool (perl mybe )? (2 Replies)
Discussion started by: umen
2 Replies

4. 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

5. Shell Programming and Scripting

sed problem - delete all lines until a match on 2 lines

First of all, I know this can be more eassily done with perl or other scripting languages but, that's not the issue. I need this in sed. (or wander if it's possible ) I got a file (trace file to recreate the control file from oracle for the dba boys) which contains some lines another line... (11 Replies)
Discussion started by: plelie2
11 Replies

6. Shell Programming and Scripting

Using SED to delete some lines from file

Hi All, I have one /etc/hosts.equiv file which has following entries ########## wcars42g admin wcars42b netmgr wcars42b oemssrvr wcars42f admin wcars42f netmgr wcars42f oemssrvr ########## I am trying to delete lines starting from wcars42b.... (1 Reply)
Discussion started by: akash_mahakode
1 Replies

7. Shell Programming and Scripting

Sed to delete lines that with the following

Hi, I'm very new to Sed and I have a very large file that contains data in the following way (*064) 1 4 10 (*064) simulation time = 0.12000E-05 (*064) 1 2 10 (*064) 1 3 10Essentially what I want to do it delete every line that starts with '(*064) 1'I tried the following, ... (2 Replies)
Discussion started by: lost.identity
2 Replies

8. Shell Programming and Scripting

Delete lines with SED in Bash?

Hello everyone I'm doing a program in bash and wanted to know how can I do to delete document lines the words not ending in S with SED, ie, show only those ending with the letter S. I probe with: sed -e /$.*/d "$file" | more to delete all lines NOT ending in S but not work!... (3 Replies)
Discussion started by: adiegorpc
3 Replies

9. Shell Programming and Scripting

Sed/awk to delete single lines that aren't touching other lines

Hello, I'm trying to figure out how to use sed or awk to delete single lines in a file. By single, I mean lines that are not touching any other lines (just one line with white space above and below). Example: one two three four five six seven eight I want it to look like: (6 Replies)
Discussion started by: slimjbe
6 Replies

10. Shell Programming and Scripting

sed or awk: delete n lines following a formfeed

Hi Members, This is my first post in this forum. I want to do is match form feed lines one by one in a file and delete the next n lines (ex-3 lines) with the form feed character Eg - Files looks like Data 1 Data 2 Data 3 FF Hdr1 Hdr2 Hdr3 Data4 Data5 FF Hdr1 Hdr2 Hdr3 (9 Replies)
Discussion started by: yohan
9 Replies
client.conf(5)							    Apple Inc.							    client.conf(5)

NAME
client.conf - client configuration file for cups DESCRIPTION
The client.conf file configures the CUPS client and is normally located in the /etc/cups and/or ~/.cups directories. Each line in the file can be a configuration directive, a blank line, or a comment. Comment lines start with the # character. Note: Starting with macOS 10.7, this file is only used by command-line and X11 applications plus the IPP backend. The ServerName directive is not supported on macOS at all. Starting with macOS 10.12, all applications can access these settings in the /Library/Prefer- ences/org.cups.PrintingPrefs.plist file instead. See the NOTES section below for more information. DIRECTIVES The following directives are understood by the client. Consult the online help for detailed descriptions: AllowAnyRoot Yes AllowAnyRoot No Specifies whether to allow TLS with certificates that have not been signed by a trusted Certificate Authority. The default is "Yes". AllowExpiredCerts Yes AllowExpiredCerts No Specifies whether to allow TLS with expired certificates. The default is "No". Encryption IfRequested Encryption Never Encryption Required Specifies the level of encryption that should be used. GSSServiceName name Specifies the Kerberos service name that is used for authentication, typically "host", "http", or "ipp". CUPS adds the remote host- name ("name@server.example.com") for you. The default name is "http". ServerName hostname-or-ip-address[:port] ServerName /domain/socket Specifies the address and optionally the port to use when connecting to the server. Note: This directive is not supported on macOS 10.7 or later. ServerName hostname-or-ip-address[:port]/version=1.1 Specifies the address and optionally the port to use when connecting to a server running CUPS 1.3.12 and earlier. SSLOptions [AllowDH] [AllowRC4] [AllowSSL3] [DenyCBC] [DenyTLS1.0] SSLOptions None Sets encryption options (only in /etc/cups/client.conf). By default, CUPS only supports encryption using TLS v1.0 or higher using known secure cipher suites. Security is reduced when Allow options are used. Security is enhanced when Deny options are used. The AllowDH option enables cipher suites using plain Diffie-Hellman key negotiation (not supported on systems using GNU TLS). The AllowRC4 option enables the 128-bit RC4 cipher suites, which are required for some older clients. The AllowSSL3 option enables SSL v3.0, which is required for some older clients that do not support TLS v1.0. The DenyCBC option disables all CBC cipher suites. The DenyTLS1.0 option disables TLS v1.0 support - this sets the minimum protocol version to TLS v1.1. TrustOnFirstUse Yes TrustOnFirstUse No Specifies whether to trust new TLS certificates by default. The default is "Yes". User name Specifies the default user name to use for requests. ValidateCerts Yes ValidateCerts No Specifies whether to only allow TLS with certificates whose common name matches the hostname. The default is "No". NOTES
The client.conf file is deprecated on macOS and will no longer be supported in a future version of CUPS. Configuration settings can instead be viewed or changed using the defaults(1) command: defaults write /Library/Preferences/org.cups.PrintingPrefs.plist Encryption Required defaults write /Library/Preferences/org.cups.PrintingPrefs.plist TrustOnFirstUse -bool NO defaults read /Library/Preferences/org.cups.PrintingPrefs.plist Encryption On Linux and other systems using GNU TLS, the /etc/cups/ssl/site.crl file, if present, provides a list of revoked X.509 certificates and is used when validating certificates. SEE ALSO
cups(1), default(1), CUPS Online Help (http://localhost:631/help) COPYRIGHT
Copyright (C) 2007-2017 by Apple Inc. 19 October 2017 CUPS client.conf(5)
All times are GMT -4. The time now is 04:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy