您的位置: 首页 > IT文章 > expect命令 expect命令 分类: IT文章 • 2023-11-10 18:06:24 #!/usr/bin/expect set timeout 30 spawn ssh -p [lindex $argv 0] [lindex $argv 1]@[lindex $argv 2] expect { "(yes/no)?" {send "yes ";exp_continue} "password:" {send "[lindex $argv 3] "} } interact