Scripts that talk across telnet?

Harry Bochner bochner at speed.harvard.EDU
Sat May 5 02:15:13 AEST 1990


I have a routine task that involves ftp'ing a file from a sun4 to an IBM
CMS machine, then logging into that machine via telnet, massaging the file
and then transmitting it to another user using the CMS 'sendfile' command.
I'd like to write a script to automate this, ideally a smart script that
runs silently if everything goes smoothly but that passes back any error
messages.
Is there a scripting utility available that can do this?

It looks like perl would be a good language for writing a script that
scans the responses and determines whether they look normal. The problem
is that my preliminary experiments seem to indicate that telnet doesn't
like to talk to scripts: I tried a simple script that just pipes output
to telnet, and it tells me "Connection closed by foreign host" without
doing anything else.

The best scheme I've been able to think of is to write a C pgm that opens
a pseudo-terminal, and then starts perl on the master side, and telnet on
the slave side. Will this work? Any better ideas?

Harry Bochner
bochner at endor.harvard.edu



More information about the Comp.unix.wizards mailing list