In your first example, "uid" only appears once. In the second example, it appears twice.
I don't know all the nuances of ldapsearch, but take this absurdly simple example:
to find someone with last name "smith", I can do this:
assuming this works, I can then do:
Quote:
name="smith"
ldapsearch -x sn=$name (here the shell substitutes the value of name before ldapsearch executes)
|
There should be similar functionality with any field name used by ldap. First, test the commands manually---then put them into the script.
Also, post some samples from your file......