shell script to print ldap users
Hello guys,
Could someone tell me why the code below doesn't print? I tried modifying few times but getting the same result. It is supposed to read data from a backup file, run ldapsearch, print all needed IDs defined in the ldapsearch. Somehow it prints 0, though ldapsearch in my sample ldif file works fine. It is Solaris machine.
Any help appreciated
----------------------
code:
#!/bin/ksh
while read g
do
echo ""
ldapsearch -L -h localhost -p 5555 -D "uid=sm_admin,ou=abc_admin,o=abc.com" -w sm_passwd -b o=vz.com -s sub uid=$g
done < g.ldif > g_out.txt
------------------------
input file (g.ldif):
dn: uid=testID,ou=abc,o=abc.com
objectclass: top
objectclass: someuser
uid: testID
|