[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: ldapsearch



On Thu, 28 Oct 1999 tcurdt@linux01.gwdg.de wrote:

   I like to use ldap query results in shells scripts.
   Something like:
   
   RESULT=`ldapsearch -b 'whatever' 'objectclass=Person' sn
   
   But the output format of the ldapsearch makes it necessary
   to use some more processing e.g. like:
   
   ldapsearch -b 'whatever' 'objectclass=Person' sn|tail -1|sed -e 's/.*=/\1/'
   
Yes, use the perl "Net::LDAPapi" module and make a perl ldap search and use
printf's to format it exactly how you want.

I have a small script that does a search similar to the way outlook does and
returns the results in a kind of tabular form. Let me know if you want it.   

Regards

Simon Murcott

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

 Optimation New Zealand Limited
 Exchange Place, Willeston Street, Wellington, New Zealand
 Phone +64 4 4727218, Fax +64 4 4727219, Mobile 025 405821
 S.Murcott@optimation.co.nz