I have a problem with password input in ldapsearch command. I have script witch asks for LDAP password twice I have something like this except (expect_ldap.sh) script to enter LDAP password:
#!/usr/bin/expect -d
set timeout -1
spawn sudo ./ldapu.sh
expect "Enter LDAP...