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.
You're sending the echo command without first expecting the prompt. Try:
echo
# after sending the password expect -re "> ?$" send "echo HELLO WORLD\r" expect eof