Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using telnet in script to exec commands?

Status
Not open for further replies.

StickyBit

Technical User
Jan 4, 2002
264
0
0
CA
Hi folks,

Is it possible to write a script that will send commands to my cisco router from my solaris box using telnet? Something like this.

!#/usr/bin/sh

telnet router<<EOF
passwd
en
passwd
config t
interface eth0
shutdown
EOF

Am I thinking correctly, or am I off key here? How would I accomplish the task?

StickyBit.
 
trying using perl with the expect module. I automate telnet and ftp sessions this way, works pretty good but can be quirky at times with varying input.

gabe
 
Thanks Gabe for your input.

Regards,

StickyBit.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top