标签:expec check log pad continue roo ipa script nbsp
脚本执行时,需要输入交互"y",用expect可以实现交互输入过程;
#!/usr/bin/expect -f set ipaddr [lindex $argv 0] set port "23000" spawn -noecho ssh -p $port root@$ipaddr expect { -re "\]# " { send "bash /data/app/lhzs/public/script/checksvr.sh\n" expect { -re "\]: " { send "y\n" exp_continue } -re "\]# " { send "exit\n" } } } } expect eof exit
标签:expec check log pad continue roo ipa script nbsp
原文地址:http://www.cnblogs.com/ithandonglin/p/6535047.html