Ssh = ssh expect and keep everything not change inculde parameter postion

view story

http://www.unix.com – I have write a script which contains Code: ssh -p 12345 [email protected] ssh -p 5555 "$CMD" ssh root@$GUEST_IP "$CMD" before I use public key, it works well, now I want to change to "expect", BUT I don't want to change above code and "parameter position" I can post a expect template can some one help me to modify it Code: #cat sshx #!/usr/bin/expect set timeout  60 set host [lindex $argv 0] set name root set password root spawn  ssh $host -l $name expect {   "(yes/no)?" {       (HowTos)