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

ldapsearch output



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Is there a way to have ldapsearch return a single value? I'd like to
give it a uid name and have it just return the uidNumber. If I enter this:
ldapsearch -x "(uid=hsimpson)" uidNumber
# extended LDIF
#
# LDAPv3
# base <> with scope sub
# filter: (uid=hsimpson)
# requesting: uidNumber
#

# hsimpson, People, aorganise.com
dn: uid=hsimpson,ou=People,dc=mydomain,dc=com
uidNumber: 1012

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

...I'm getting way to much back for my scripts.

All I want is 1012. Is there a better way to filter this or will I have
to do it elsewhere (like perl)?

Thanks!

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFAs4k6RJX8S0T0CkURAj9GAJ46u0sRsE6IkYTQxhwN2pKCdIkLLwCeLL8R
aa+g0vVqMONZFP0lndwaxMQ=
=RPvB
-----END PGP SIGNATURE-----