Hunter的大杂烩

March 21, 2016

expect脚本范例

Filed under: 技术话题 — hunter @ 3:40 pm

#!/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