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
相關文章
相關標籤/搜索