Linux远程自动输入密码抓取远程资源

#!/usr/bin/expect -f
set timeout 3000
set sys_date [lindex $argv 0] #要抓取的文件日期
spawn scp /data3/xiaorui/cellphone_data/wo_dm_${sys_date}.lst  aimcpro@10.199.82.119:/m47/wodm_device
expect {
"(yes/no)?" {
send "yes\r";exp_continue #继续下面的匹配
}
"password:" {
send "aimcpro@CUWO\r"
}
}
expect eof

posted on 2014-07-14 20:35  a_badegg  阅读(218)  评论(0编辑  收藏  举报

导航