Expect Scripting Help

Hi All,

I am trying to connect a router using Expect scripting. But my script shows error.One more thing after the command telnet localhost 2000
we should press ENTER KEY once before the command prompt asks for "enable" and password.Please help correctiong my script.

#!/usr/bin/expect --

spawn telnet localhost 2000
expect "\n"
send "enable\r"
expect "Password:"
send "reso\r"

Regards,
Harikrishna.

What error? Can you provide a screen grab?

Hey Jerry the script worked...

Thanks and Regards
Harikrishna.