How to automate telnet session using Expect?
问题 I'm trying to write an expect script to automate telnet. This is what I have so far. #!/usr/bin/expect # Test expect script to telnet. spawn telnet 10.62.136.252 expect "foobox login:" send "foo1\r" expect "Password:" send "foo2\r" send "echo HELLO WORLD\r" # end of expect script. Basically, what I want to do is telnet to the following IP address and then echo HELLO WORLD. However, it seems that the script fails after attempting to telnet...I'm not sure if it's able to accept login and