+ -
当前位置:首页 → 问答吧 → 请教个expect的问题??

请教个expect的问题??

时间:2011-06-21

来源:互联网

expect <<!
set timeout -1
spawn ssh [email protected]
expect "*(yes/ no)?*" {send "yes\r"; exp_continue} \
"[email protected]'s  password:"{send "kjk123\r"}
send "echo  888888 > 1.txt\r"
send "exit\r"
expect eof
!
ssh 到10.10.17.3 可能ssh第一次登录,会提示yes/no我这么判断为什么不行呢?

如果以前登录过的话 就直接提示输入密码

作者: 267020090   发布时间: 2011-06-21

http://bbs.chinaunix.net/redirec ... 48&pid=12387660

作者: waker   发布时间: 2011-06-21

??

作者: 267020090   发布时间: 2011-06-21

哪位大哥指点下 谢谢

作者: 267020090   发布时间: 2011-06-21