1
你能告诉我为什么这个Expect脚本在循环模式下显示日历吗? 我只想看到一个日历。使用expect登录并发出命令
#!/usr/bin/expect
set fid [open /Users/john/secret]
set password [read $fid]
close $fid
spawn ssh [lindex $argv 0]@[lindex $argv 1]
expect {
-re ".*Are.*.*yes.*no.*" {
send "yes\n"
exp_continue
}
"*?assword:*" {
send $password
send "\n"
exp_continue
}
"*$*" {
send "cal\r"
exp_continue
}
"*$*" {
send "exit\r"
}
非常感谢!我现在就来! – user1658549