#!/usr/bin/expect
set timeout 30
spawn scp -r /data/tomcat/webapps/ROOT/ root@10.10.10.10:/data/tomcat/webapps/
expect {
"yes/no" {send "yes\r";exp_continue}
"password:" {send "密码*******\r"}
}
interact
set timeout 30
spawn scp -r /data/tomcat/webapps/ROOT/ root@10.10.10.10:/data/tomcat/webapps/
expect {
"yes/no" {send "yes\r";exp_continue}
"password:" {send "密码*******\r"}
}
interact