Why does automating SFTP with Expect hang after sending the password?
问题 I am attempting to automate uploading some files from my Linux server to an FTP-enabled Windows server. I am successfully doing so manually using SFTP and then issuing the put command. However, when called from cron, my script keeps stopping for a password. Below is the code I am attempting to use: #!/usr/bin/expect #!/bin/sh clear spawn sftp remoteuser@43.123.0.10 expect "password" send "world" expect eof As it stands, it stops each time to request a password. Why doesn't send "world"