Summary: Scripting a telnet session

From: Andreas Hoeschler <>
Date: Fri Apr 12 2002 - 18:13:02 EDT
Thanks a lot to all who responded to my request. I got 50 or so replies. 
Most recommended to use expect. I downloaded and compiled expect and 
then wrote the following script which did what I want.

log_file -noappend "telnetoutput.txt"
spawn telnet
expect "assword: "
send "12345\r"
expect ">"
send "ip route status\r"
expect ">"
send "exit\r"

Special thanks to Mike Bruno who provided the script.



sunmanagers mailing list
Received on Fri Apr 12 18:31:23 2002

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:42:40 EST