出处:http://www.cnblogs.com/gnuhpc/
#!/usr/bin/expect -f set timeout 30 spawn ssh -l root 192.168.191.244 expect "password:" send "passw0rd/r" send "cd /var/bin/r" send "./apachectl stop/r" send "sleep 1/r" send "./apachectl start/r" interac 本文转自gnuhpc博客园博客,原文链接:http://www.cnblogs.com/gnuhpc/archive/2012/10/13/2722912.html,如需转载请自行联系原作者t