标签:linu word style pre host expect div lis ssh
#!/usr/bin/expect set host "192.168.31.100" set password "lishiming" spawn ssh root@$host expect { "yes/no" { send "yes\r"; exp_continue } "assword:" { send "$password\r" } } expect "]*" send "touch /tmp/1.txt\r" expect "]*" send "echo 1212 > /tmp/1.txt\r" expect "]*" send "exit\r"
标签:linu word style pre host expect div lis ssh
原文地址:http://www.cnblogs.com/pzk7788/p/6771491.html