#!/usr/bin/expect-f
set password 123456
#download
spawn scp root@192.168.1.218:/root/a.wmv /home/hbhe/
set timeout 300
expect "root@192.168.1.218'spassword:"
set timeout 300
send "$password\r"
set timeout 300
send "exit\r"
expect eof
#upload
spawn scp /home/hbhe/abc.sqlroot@192.168.1.218:/root/test.sql
set timeout 300
expect "root@192.168.1.218'spassword:"
set timeout 300
send "$password\r"
set timeout 300
send "exit\r"
expect eof
阅读(1543) | 评论(0) | 转发(0) |