给多主机传输文件脚本

#!/bin/bash
for i in 192.168.30.{22..23}
do
/usr/bin/expect <<-EOF
        spawn scp /root/99.sh root@$i:/root
        expect {
                "yes/no" { send "yes\r";exp_continue }
                "password" { send "666666\n" }
        }
        expect eof
EOF
done


猜你喜欢

转载自www.cnblogs.com/zc1741845455/p/10884800.html