I am using ldapsearch
with its -y
option where the password for the ldap server is read in from a file in order to ensure that the password is not left in the command history.
ldapsearch
requires that the password be in a file with no newlines. The only way I am aware of for doing this is:
echo -n "myreallysecretpassword" > /path/to/password.txt
but obviously that puts the password in the command history, which is what I'm trying to avoid.
I assume there's a better way, could someone point me in the right direction?