Tcl Expect fails spawning SSH to server but SSH from command line works
问题 I have some code that I'm using to connect to a server and perform some commands. The code is as follows: #!/usr/bin/expect log_file ./log_std.log proc setPassword {oldPass newPass} { send -- "passwd\r" expect "* Old password:" send -- "$oldPass\r" expect "* New password:" send -- "$newPass\r" expect "* new password again:" send -- "$newPass\r" } set server [lindex $argv 0] spawn /bin/ssh perfgen@$server # Increase buffer size to support large text responses match_max 100000 # Conditionally