有人可以告诉我为什么这不起作用吗?
#!/bin/bash
cd /home
touch somefile
/usr/bin/expect<<FILETRANSFER
spawn scp -r -P remoteServerPort somefile remoteServerIP:/home
expect "assword:"
send "MyPassWord\r"
interact
FILETRANSFER
echo "It's done"
Run Code Online (Sandbox Code Playgroud)
它没有给出任何错误,但是文件没有传输到远程服务器。我尝试了许多方法仍然找不到任何解决方案。