为什么我的expect脚本运行速度这么慢......
很普通的自动登录脚本,内容如下:
#!/usr/bin/expect -f
if { $argc != 3 } {
puts stderr "Usage: deploy host username password\n"
exit 1
}
set timeout 60
set host [lindex $argv 0]
set name [lindex $argv 1]
set password [lindex $argv 2]
spawn ssh $name@$host
expect "*assword:"
send "$password\n"
expect "*$"
send "touch ttt\n"
expect "*$"
send "exit\n"
expect eof
为什么就这么点内容要执行几分钟?速度也太慢了吧......