expect脚本问题
#!/usr/bin/expect -f
set name [lindex $argv 0]
set server [lindex $argv 1]
spawn ssh $name@$server
expect "yes/no"
send "yes\r"
expect "password:"
send "owner\r"
expect "$"
send "df -k>>1.log"
expect "$"
send "scp 1.log oracle@1.11.11.11:/home/test/\r"
expect "password:"
send "owner2\r"
exit
我这样写行不行 运行结果 1.11.11.11下并没有1.log,也没有下载到本地 希望大家帮着看看
[解决办法]
现在登录也登不上了??你是手动ssh也不行吗???