aggunia
asked on
How to process file contents in a shell script.
I would lke to read the contents of a file in a bourne shell script containing a user IDs and run them against an ldapsearch command. Here's the following section which doesn't seem to work:
for id in /var/tmp/ldap_user_problem s_sort.log ;
do
ACCOUNT=$id;
/usr/bin/ldapsearch -h DEVLDAP_TREE "(&(hcscteamsiterole=*)(ui d=$ACCOUNT )(!(gecos= *)))" fullname gecos >>$LOGFILE 2>&1
done
The above section does not throw an error, but I get no output. If I run the ldapsearch command inserting a real UID in place of the variable, I get data. Could someone out there let me know what I'm doing wrong here? Thanks!
Anthony
for id in /var/tmp/ldap_user_problem
do
ACCOUNT=$id;
/usr/bin/ldapsearch -h DEVLDAP_TREE "(&(hcscteamsiterole=*)(ui
done
The above section does not throw an error, but I get no output. If I run the ldapsearch command inserting a real UID in place of the variable, I get data. Could someone out there let me know what I'm doing wrong here? Thanks!
Anthony
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER