rui.qin.o@MBC02XT0K4JGH7 bin % cat login.exp
#!/usr/bin/expect
set timeout 30
spawn ssh -p [lindex $argv 2] [lindex $argv 0]@[lindex $argv 1]
expect {
"(yes/no)?"
{send "yes\n";exp_continue}
"password:"
{send "[lindex $argv 3]\n"}
}
interact
rui.qin.o@MBC02XT0K4JGH7 bin % ./login.exp jenkins 10.110.93.11 22 12345