[plug] Automated Telneting?

Andrew Howell andrew at vila.it.net.au
Wed Aug 4 17:38:21 WST 1999


On Wed, Aug 04, 1999 at 05:38:06PM +0800, Paul Baumgarten wrote:
> I would like to be able to create a shell script that telnets into another
> machine, executes some commands and closes the telnet connection.  Until now
> I have tried using something along the lines of the following in my script
> file.
> 
> # telnet 192.168.2.2 < inputstuff > outputstuff
> 
> Unfortunately it appears as though the input buffer is fed straght into the
> keyboard buffer and the telnet session closes, all before it has done
> anything.  The input buffer isn't waiting until telnet has established it's
> connection and put up it's prompt.
> 
> If anyone knows of a way to make scripts do telneting I would appreciate it.

Use expect

Andrew

-- 
Andrew Howell
Managing Director
Informed Technology
E-mail: andrew at it.net.au
Ph: 08 9380 4244  Fax: 08 9380 4354


More information about the plug mailing list