Please can some one tell me how can i delete all the lines between the text <!-- The custom module to do the authentication for LDAP
--> and </authentication>
I have seen there are many sed posts but still it is quite difficult to apply other post to my own problem
How can I delete all lines in a file from 2 lines after this pattern
*End_fine_coreg:_NORMAL
to the end of file?
Cheers (2 Replies)
I take the /etc/passwd file and print it out, but I only want the lines that end with sh.
I have
cat /etc/passwd | sed '/sh/!d' Which prints out all lines that have sh somewhere in it.
So I added $, which I thought matches the ends on lines, but its not working, like for example I have have... (5 Replies)
I want to delete lines like this
sed '/FROM_HERE/,/TO_HERE/d'
but I would like to *not* delete the second match, i.e. the TO_HERE line. How can I achieve this?
Thank you! (1 Reply)
Hi All,
Please can anyone help me as am deleting a line in a file with the below script:
sed '/"$value"/d' redirects.virgin-atlantic.com.conf > olist
where $value is a variable where the pattern to be matched is stored.
I am not getting any error also but the line containing the pattern... (2 Replies)
Hi Gurus,
I have a file say for ex. file1 which has 3500 lines in it which are different account numbers and another file (file2) which has 230000 lines in it. I want to read all the lines in file1 and delete all those lines from file2 which has that same pattern as in file1. I am not quite... (4 Replies)
As an example (just an example, this could apply to any block of text) say I have this:
architecture x86_64
cputype CPU_TYPE_X86_64
cpusubtype CPU_SUBTYPE_X86_64_ALL
offset 4096
size 2972420
align 2^12 (4096)
architecture ppc64
cputype CPU_TYPE_POWERPC64
cpusubtype... (3 Replies)
I want to delete 1 line above the paatern and 3 lines below the pattern and the pattern line itself, on the whole 5 lines. If there are three patterns to be deleted what to do and the final text file to be captured in a new file. (1 Reply)
I want to delete 1 line above the paatern and 3 line below the pattern and the pattern line itself, on the whole 5 lines. If there are three patterns what to do and the final text file to be captured in a new file. (3 Replies)
Hi,
I have a file with the content:
for name in \
sree\
rama\
laila\
srihari\
vicky\
john
do
echo $name
done
I need to remove all the name lines that exist between for (first line) and do line so that i can replace with new names.
Output file should look like: (3 Replies)
Discussion started by: raosr020
3 Replies
LEARN ABOUT CENTOS
lwp::protocol::ldap
LWP::Protocol::ldap(3) User Contributed Perl Documentation LWP::Protocol::ldap(3)NAME
LWP::Protocol::ldap - Provide LDAP support for LWP::UserAgent
SYNOPSIS
use LWP::UserAgent;
$ua = LWP::UserAgent->new();
$res = $ua->get('ldap://ldap.example.com/' .
'o=University%20of%20Michigan,c=US??sub?(cn=Babs%20Jensen)',
Accept => 'text/json'):
DESCRIPTION
The LWP::Protocol::ldap module provides support for using ldap schemed URLs following RFC 4516 with LWP. This module is a plug-in to the
LWP protocol handling, so you don't use it directly.
In addition to being used with LDAP URIs, LWP::Protocol::ldap also acts as the base class for its sibling modules LWP::Protocol::ldaps and
LWP::Protocol::ldapi.
Features
HTTP methods supported
LWP::Protocol::ldap implements the HTTP GET and HEAD methods. They are mapped to the LDAP search operation,
Response format
Depending on the HTTP Accept header provided by the user agent, LWP::Protocol::ldap can answer the requests in one of the following
formats:
DSML
When the HTTP Accept header contains the "text/dsml" MIME type, the response is sent as DSMLv1.
JSON
When the HTTP Accept header contains the "text/json" MIME type, the response is sent as JSON. For this to work the JSON Perl module
needs to be installed.
LDIF
When the HTTP Accept header contains the "text/ldif" MIME type, the response is sent in LDIFv1 format.
HTML
In case no HTTP Accept header has been sent or none of the above MIME types can be detected, and the x-format extension has not been
provided either, the response is sent using HTML markup in a 2-column table format (roughly modeled on LDIF).
As an alternative to sending an HTTP Accept header, LWP::Protocol::ldap also accepts the "x-format" extension
Example:
ldap://ldap.example.com/o=University%20of%20Michigan,c=US??sub?(cn=Babs%20Jensen)?x-format=dsml
TLS support
For ldap and ldapi URIs, the module implements the "x-tls" extension that switches the LDAP connection to TLS using a call of the start_tls
method.
Example:
ldap://ldap.example.com/o=University%20of%20Michigan,c=US??sub?(cn=Babs%20Jensen)?x-tls=1
Note: In the above example, ideally giving "x-tls" should be sufficient, but unfortunately the parser in URI::ldap has a little flaw.
Authorization
Usually the connection is done anonymously, but if the HTTP Authorization header is provided with credentials for HTTP Basic authorization,
the credentials given in that header will be used to do a simple bind to the LDAP server.
SEE ALSO
LWP::Protocol::ldaps, LWP::Protocol::ldapi
COPYRIGHT
Copyright (c) 1998-2004 Graham Barr, 2012 Peter Marschall. All rights reserved. This program is free software; you can redistribute it
and/or modify it under the same terms as Perl itself.
perl v5.16.3 2013-06-08 LWP::Protocol::ldap(3)