Handling output from ldapsearch
- From: utbloke@xxxxxxxxx
- Date: Mon, 30 Jun 2008 06:38:57 -0700 (PDT)
In the following example output (from an exec call to ldapsearch) am
trying to figure out how to just derive a list of the sAMAccountName
values:
"dn: CN=user01,CN=Users,DC=mynet,DC=local
sAMAccountName: user01
dn: CN=user02,CN=Users,DC=mynet,DC=local
sAMAccountName: user02
dn: CN=user03,CN=Users,DC=mynet,DC=local
sAMAccountName: user03"
....ideally, resulting in a list like this (based on above):
"user01 user02 user03"
Have tinkered with regexp/lsearch et al (for many hours now), searched
various wiki's, google and also scanned Mr Welch's good book for clues
but still no luck ...apart from realising my skills are very much at
beginner level. What's the best way to approach this?
BTW ...would prefer *not* to write ldapsearch output to a file and
then read in the file if possible.
Kind Regards,
UTB
.
- Follow-Ups:
- Re: Handling output from ldapsearch
- From: Glenn Jackman
- Re: Handling output from ldapsearch
- From: Helmut Giese
- Re: Handling output from ldapsearch
- From: schlenk
- Re: Handling output from ldapsearch
- Prev by Date: Re: Limiting resources used by scripts on web server
- Next by Date: Re: Handling output from ldapsearch
- Previous by thread: How to know how many row(or column) has information in Excel file?
- Next by thread: Re: Handling output from ldapsearch
- Index(es):