#!/usr/bin/expect
spawn sftp <user@server>
expect “password:”
send “pwd\n”;
expect “sftp>”
send “cd incoming\n”
expect “sftp>”
send “put zz.txt\n”
expect “sftp>”
send “quit\n”
send “exit\n”
-bash: spawn: command not found
couldn’t read file “password:”: no such file or directory
-bash: send: command not found
couldn’t read file “sftp>”: no such file or directory
-bash: send: command not found
couldn’t read file “sftp>”: no such file or directory
-bash: send: command not found
couldn’t read file “sftp>”: no such file or directory
-bash: send: command not found
-bash: send: command not found
1 Answer