[comp.lang.rexx] Scripting a TELNET session

fuchs@tsar.Princeton.EDU (Ira Fuchs) (07/06/90)

I am looking for a way to "Script" a TELNET session (and less importantly,
a TIP session). That is, I want to be able to write a script which will 
read data received and send data based on it (and other variables). Ideally
I would like to use an existing language such as PERL, REXX, SNOBOL, etc.
Has anyone ever developed the hooks to permit this?

gettes@yo.Princeton.EDU (Michael R. Gettes) (07/13/90)

In article <1059@idunno.Princeton.EDU>, fuchs@tsar.Princeton.EDU (Ira
Fuchs) writes:
> I am looking for a way to "Script" a TELNET session (and less importantly,
> a TIP session). That is, I want to be able to write a script which will 
> read data received and send data based on it (and other variables). Ideally
> I would like to use an existing language such as PERL, REXX, SNOBOL, etc.
> Has anyone ever developed the hooks to permit this?

I believe PERL has built-in network functions such as BIND CONNECT and
such -- much like
standard socket interface. I have recently requested these features be
included in the
uni-REXX product from the Workstation Group -- they are considering it.

I believe the public domain PERL has a refcard which describes these functions.

/mrg

jonesjg@wyvern.rtp.dg.com (Greg Jones) (07/13/90)

    A PD utility called expect was designed by Don Libes at NIST for 
    script driving interactive commands like Telnet.  It uses a PD
    language called Tcl.  Below is the readme file from the release
    which includes info on how to get a copy.  Other than getting a copy
    and getting it running I have no experience with the tool.  
    I do know that it has been reciently updated from the version I have
    so atleast someone is continuing to work on it.

------------------------------------------------------------------------
---------

This is the README file from "expect", a program that performs
programmed dialogue with other interactive programs.  It is described
further in the man page, expect(1).  It is also described in "expect:
Curing Those Fits of Interaction" by Don Libes, Proceedings of the
Summer 1990 USENIX Conference, Anaheim, California, June 11-15, 1990.

expect was designed and written by Don Libes, January - March, 1990.

expect may be ftp'd as pub/expect.shar.Z from durer.cme.nist.gov.
Note that expect requires Tcl.  Tcl may be ftp'd as pub/tcl.tar.Z from
ucbvax.berkeley.edu.  If this file is not present, a potentially older
but working version of Tcl may be ftp'd as pub/tcl.tar.Z from
durer.cme.nist.gov.

expect is known to work on SunOS 4.0 systems but it does nothing Sun
specific and will probably work on most BSD-derived systems .  While
it has not been compiled on SV or POSIX systems, I have made
provisions enough so that probably only minor changes remain.  (See
the Makefile for more info.)  This might be presumptive however, as I
recently looked at the process control in gnuemacs and am amazed how
much pain it took them to make it portable.  Perhaps someday I will
change to using their code.  I would be willing to work with you to
complete a port.  (However, as as I write this, Tcl has not been
ported either, and I am not responsible for that.)

Design and implementation of this program was paid for by U.S. tax
dollars.  Therefore it is public domain.  However, the author and NIST
would appreciate credit if this program or parts of it are used.

Please send money, love letters, and bug reports to:

Don Libes
National Institute of Standards and Technology
Bldg 220, Rm A-127
Gaithersburg, MD  20899
(301) 975-3535
libes@cme.nist.gov   or   uunet!cme-durer!libes

------------------------------------------------------------------------
-----------

    J. Greg Jones 	
    Data General Corp - RTP, NC 
    jonesjg@dg-rtp.dg.com.
    (919)248-6068