|
[root@ser1 /etc/namedb]# cat update_d2.sh
#!/usr/local/bin/expect
set timeout 10
spawn ssh lining@d2.myconfigo.com
send "sudo cp -rf /home/lining/very/myconfigo.ini /var/named/etc/namedb/myconfigo.ini \r"
send "sudo /var/named/etc/namedb/update.sh \r"
send "exit \r"
[root@ser1 /etc/namedb]#
#su lining -c ./update_d2.sh
spawn ssh bigxu@d2.sunbo.c
#
执行后,停在了expect状态
分句执行则可以 |
|