I am working on a simple bash script to download images from the website Tumblr. The idea is to use read
to get login info from the user, and wget --post-data
to log in, and this is what I have:
read -p "Tumblr login email: " EMAIL read -p "Tumblr login password: " PASSWRD wget --user-agent=Mozilla/5.0 --save-cookies cookies.txt --post-data 'email=$EMAIL&password=$PASSWRD' --no-check-certificate https://www.tumblr.com/login
However, it is sending "$EMAIL"
and "$PASSWRD"
instead of the strings for the variables, is there any way to get it to send values that have been inputted by the user?
Wget does not currently support multipart/form-data for transmitting POST data; only application/x-www-form-urlencoded . Only one of ' --post-data ' and ' --post-file ' should be specified.
change:
--post-data 'email=$EMAIL&password=$PASSWRD'
to:
--post-data="email=$EMAIL&password=$PASSWRD"
bash manual about Quoting
: http://www.gnu.org/software/bash/manual/bashref.html#Quoting
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With