1

sftp a file using shell script

view story
linux-howto

http://unix.stackexchange.com – 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 root@XX.XX.XX.XX 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 (HowTos)