I am building FTP Script on my Bluehost VPS Server. I have several and all work great except this one.... I think there are two issues .. One with the command and One with "$" in the password.
#!/bin/sh
HOST=invtransfer@52.44.151.220
USER=invtransfer
PASSWORD=XXX$XXX - $ is real in password....
sftp $HOST <<EOF
user $PASSWORD
get INVENTORY.txt
exit
EOF
This is one of the MANY different things I have tried... It connects and asks for the password - if I type it in then it gets the file..
Cannot get it to correctly deliver the password..
Any help would be appreciated... I know is must be something small.
I did not catch that before but you are not using FTP like you said initially. You are using SFTP. It doesn't work like that. It will not read a password from a stream. Either you set it up with a ssh key pair or you have to enter the password interactively.