BASH (or else) scripting for Telnet

Hi everybody,

I am thinking on writing a shell script to telnet to Cisco routers, and I am looking for help. I have researched some and could not find much on the topic, or at least much of help anyway...

I read "expect" is one solution, but I am looking for something more flexible, as I might be looking into several different type of responses and actions.

For instance, I may get different prompts when logging in like:

Username: 

or

Password:

and once I am past login, I might get either:

hostname>

for a session with no privileges
or

hostname#

for a session in privileged mode.

And so forth...

Any clues? :slight_smile:

I'm not sure what you will find more flexible than expect. It is perfect for this job.