The following should be done in a bash script:
curl --digest --user schmijos https://bitbucket.org/u/p/get/tip.zip -o tip.zip
How can I automatically submit a password to curl when it asks for it? Since I don't want to see the password in any logfile, I won't do the following:
curl --digest --user schmijos:$password https://bitbucket.org/u/p/get/tip.zip -o tip.zip
Best Answer
Use
empty
:With the password safely stored (it's a way of saying...)
Start process with
empty
. (You would omit-L log
in the real case.)Send the contents of
pwd-file
toempty
's input pipe, which the process sees as both itsstdin
and/dev/tty
.This is what happened in the pseudo terminal: