Link to home
Start Free TrialLog in
Avatar of aggunia
agguniaFlag for United States of America

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_problems_sort.log ;
do
ACCOUNT=$id;
/usr/bin/ldapsearch  -h DEVLDAP_TREE "(&(hcscteamsiterole=*)(uid=$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

ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aggunia

ASKER

Thanks...that worked!