expect无交互操做

#!/usr/bin/expect set ip '192.168.4.5' set pwd '123456' set timeout 30 spawn ssh root@$ip expect { "yes/no" {send "yes\r";exp_continue} "password:" {send "$pwd\r"} } interact # 保持在远程终端 #!/usr/bin
相关文章
相关标签/搜索