telnet in a shell script

Don Libes libes at cme.nist.gov
Wed Nov 14 20:44:54 AEST 1990


In article <7006:Nov1408:13:3290 at kramden.acf.nyu.edu> brnstnd at kramden.acf.nyu.edu (Dan Bernstein) writes:
>One big advantage of the sh/pty version over Don's expect-based version
>is that expect can't handle telnet job control. sh can't either, but at
>least the user can type ``^]z'' to telnet followed by ``^Z'' to regain
>his shell.

expect does understand job control.  (The man page explains all this.)
By default, "interact" passes characters like ^Z and ^] to the interactive
process (telnet, in this case) which is usually what is desired.  If you
want a csh you can suspend back to, just spawn a csh first.  Or, if you
want to suspend expect itself, just press the interact escape character
and you'll get back to the expect interpreter from which you can suspend
back to your shell by typing ^Z.  (This is how telnet itself works, too.)

Please, Dan, go ahead and talk about your own work, but stop trying to
explain mine.  You've done it an injustice every time.  Do me a favor
and don't even mention expect in your postings.

Don Libes          libes at cme.nist.gov      ...!uunet!cme-durer!libes



More information about the Comp.unix.admin mailing list