troubleshooting Question

How to process file contents in a shell script.

Avatar of aggunia
agguniaFlag for United States of America asked on
Shell Scripting
2 Comments1 Solution652 ViewsLast Modified:
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 ;
/usr/bin/ldapsearch  -h DEVLDAP_TREE "(&(hcscteamsiterole=*)(uid=$ACCOUNT)(!(gecos=*)))" fullname gecos >>$LOGFILE 2>&1

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!



Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros