![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Linux Shell Question: how to print the shell script name ? | meili100 | UNIX for Dummies Questions & Answers | 3 | 07-01-2008 01:55 PM |
| shell script to print '*' triangle | akash | Shell Programming and Scripting | 12 | 01-10-2008 12:18 AM |
| shell script help for users | cmontr | Shell Programming and Scripting | 9 | 11-15-2007 10:17 AM |
| link LDAP-Users | funksen | UNIX for Advanced & Expert Users | 3 | 02-19-2007 01:13 PM |
| Equivalent of ADMCHG for LDAP Users | vipas | UNIX for Advanced & Expert Users | 0 | 12-16-2004 12:09 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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 |
|
||||
|
Quote:
If you just run the ldapsearch for a single user id as; 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=xyz It will work and print the ID info. But what I want is to put this in a loop that will run thru the backup ldif file and print all user ids as specified in the ldapsearch. Any help is appreciated. |
|
||||
|
Hi -
For example, the output could be the all dn value or just the uids: such as: dn: uid=testID1,ou=abc,o=abc.com dn: uid=testID2,ou=abc,o=abc.com dn: uid=testID3,ou=abc,o=abc.com dn: uid=testID4,ou=abc,o=abc.com or: testID1 testID2 testID3 testID4 etc... It should loop through the big backup file, 15+GB and print the values. Then I need to be able to FTP those. That will be automated and I am working on it. Hopefully I will resolve this why it isn't printing. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|