#!/usr/bin/expect -f
spawn scp user@ip:/target.tar /data/target.tar
set timeout -1
expect “*assword:”
exec sleep 1
send “mypassword”
expect eof
2016-03-21
expect脚本范例
Comments Off on expect脚本范例
#!/usr/bin/expect -f
spawn scp user@ip:/target.tar /data/target.tar
set timeout -1
expect “*assword:”
exec sleep 1
send “mypassword”
expect eof
Powered by WordPress