I have created a shell script to telnet remote machine. Here is the problem I am not able to pass the login username and password to the telnet session. I have searched forum and got few other methods to achieve this. But I need to know what's wrong in the below script.
username="root"
password="password"
telnet 102.240.101.223
spawn
expect "login:"
send $username
expect "password:"
send $password
send "exit"
expect eof
Thanks in advance