except用法

#!/usr/bin/expect
set timeout 20

spawn ssh -l root 172.25.254.102
expect "(yes/no)?"
send "yes\r"
expect "password"
send "Asimov\r"
expect "#"
send "hostname;exit\r"
expect eof
posted @ 2016-07-26 17:21  夏日花开  阅读(165)  评论(0编辑  收藏  举报