摘要:
1.首先确定是否安装expect/home/root> which expect/usr/bin/expect如果没有安装,先安装一下安装方法: 请参考http://www.cnblogs.com/daojian/archive/2012/10/10/2718390.htmlyour script:#!/usr/bin/expect -f#!/usr/bin/expect -f set ip 16.235.158.92 set password redhat06 set timeout 5 spawn ssh sqdev8@$ip expect { "*yes/no" 阅读全文