Summary: Scripting a telnet session

From: Andreas Hoeschler <ahoesch_at_smartsoft.de>
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.

#!/usr/local/bin/expect
log_file -noappend "telnetoutput.txt"
spawn telnet 192.168.1.254
expect "assword: "
send "12345\r"
expect ">"
send "ip route status\r"
expect ">"
send "exit\r"

Special thanks to Mike Bruno who provided the script.

Regards,

    Andreas

_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
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