I'm trying write a script shell to simplifies the change of pass of users.
function verificaSenha(){
whoAmI=`whoami`
param=`echo "ldapsearch -x -W -D \"uid=$whoAmI,ou=People,dc=ifce,dc=edu,dc=br\" -b \"dc=ifce,dc=edu,dc=br\" \"(uid=$whoAmI)\""`
exec `echo "$param"`
}
the line param=... produces a command line that when I write directly in the term it works, however in the line exec "$param" I am solicitated my LDAP pass (like in directly term) but when I type I get
ldapsearch -x -W -D "uid=inacio,ou=People,dc=ifce,dc=edu,dc=br" -b "dc=ifce,dc=edu,dc=br" "(uid=inacio)"
Enter LDAP Password:
ldap_bind: Invalid DN syntax (34)
additional info: invalid DN
what is wrong?
Best regards!!
--
Atenciosamente,
prof. Inácio Alves