I have read through several threads (which have been helpful) and I'm still getting an error when trying to sftp a file (client wants it to be sftp'ed)
Here is the script:
#!/bin/bash
HOST=XX.XX.XX.XX
PORT=XXXX
USER=root
FILE=/tmp/RANDY
/usr/bin/expect<<EOD
spawn sftp -o Port=$PORT $USER@$HOST
expect "sftp>"
spawn put $FILE
interact
EOD
The error I am receiving is:
spawn sftp -oPort=XXXX [email protected]
Connecting to XX.XX.XX.XX...
sftp> spawn put /tmp/RANDY
couldn't execute "put": no such file or directory
while executing
"spawn put /tmp/RANDY"
The file exists and is in the correct directory.