标签:usr sts pass expect 远程 +++ span root tin
+++++++++++++++++++++++++++++++++++++
标题:expect 远程传输文件
时间:2020年3月3日
+++++++++++++++++++++++++++++++++++++
#/usr/bin/env expect
set ip 192.168.100.100
set user root
set password centos
set timeout 5
spawn scp -r /etc/hosts ${user}@${ip}:/tmp
expect {
"yes/no" { send "yes\r" ; exp_continue }
"passsword" { send "${password}\r" }
}
expect eof
标签:usr sts pass expect 远程 +++ span root tin
原文地址:https://www.cnblogs.com/lv1572407/p/12404167.html