except用法

#!/usr/bin/expect
set timeout 20

spawn ssh -l root 172.25.254.102
expect "(yes/no)?"
send "yes
"
expect "password"
send "Asimov
"
expect "#"
send "hostname;exit
"
expect eof
原文地址:https://www.cnblogs.com/hanfei-1005/p/5708248.html