Xref: utzoo alt.sys.sun:812 comp.unix.wizards:21811 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker!paperboy!husc6!speed!bochner From: bochner@speed.harvard.EDU (Harry Bochner) Newsgroups: alt.sys.sun,comp.unix.wizards Subject: Scripts that talk across telnet? Message-ID: <2782@husc6.harvard.edu> Date: 4 May 90 16:15:13 GMT Sender: news@husc6.harvard.edu Reply-To: bochner@speed.harvard.EDU (Harry Bochner) Followup-To: alt.sys.sun Organization: Aiken Computation Laboratory, Harvard University Lines: 21 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@endor.harvard.edu