Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!hsi!hsi86!kenney From: kenney@hsi86.hsi.com (Brian Kenney) Newsgroups: comp.unix.misc Subject: Re: UNIX Callback Program Message-ID: <3588@hsi86.hsi.com> Date: 9 May 91 16:21:43 GMT References: <41301@fmsrl7.UUCP> <1991May8.121030.13825@cbnews.cb.att.com> Reply-To: kenney@hsi.com (Brian Kenney) Distribution: na Organization: 3M Health Information Systems, Wallingford, CT Lines: 80 In article <41301@fmsrl7.UUCP> hugh@slee01.srl.ford.com (Hugh Fader) writes: "Does anyone know of a program which I can run on my Sun at work which "will automatically call back my PC at home after I run it. We "have such a program on our VAXen but I don't want to have to hop "though a VAX to get to the Sun. One potential catch is that there is "no modem attached directly to the Sun. There is a modem pool on the "network which the Sun can access just like any other host. You can try a program called expect. It is available *somewhere* on the net (sorry, I don't remember where). It allows programs that require a tty (like tip) to run without one. I have written an expect script that calls me back after I run it. Works well. Here is the first page of its man entry: EXPECT(1) UNIX Programmer's Manual EXPECT(1) NAME expect - programmed dialogue with interactive programs SYNOPSIS expect [ -d ] [ -c cmds ] [[ -f ] cmdfile ] [ args ] INTRODUCTION expect is a program that "talks" to other interactive pro- grams according to a script. Following the script, expect knows what can be expected from a program and what the correct response should be. An interpreted language pro- vides branching and high-level control structures to direct the dialogue. In addition, the user can take control and interact directly when desired, afterward returning control to the script. The name "expect" comes from the idea of send/expect sequences popularized by uucp, kermit and other modem con- trol programs. However unlike uucp, expect is generalized so that it can be run as a user-level command with any pro- gram and task in mind. (expect can actually talk to several programs at the same time.) For example, here are some things expect can do: + Cause your computer to dial you back, so that you can login without paying for the call. + Start a game (e.g., rogue) and if the optimal con- figuration doesn't appear, restart it (again and again) until it does, then hand over control to you. + Run fsck, and in response to its questions, answer "yes", "no" or give control back to you, based on predetermined criteria. + Connect to another network or BBS (e.g., MCI Mail, CompuServe) and automatically retrieve your mail so that it appears as if it was originally sent to your local system. There are a variety of reasons why the shell cannot perform these tasks. (Try, you'll see.) All are possible with expect. SEE ALSO Tcl(3) "expect: Curing Those Uncontrollable Fits of Interactivity" by Don Libes, Proceedings of the Summer 1990 USENIX Confer- ence, Anaheim, California, June 11-15, 1990. "Tcl: An Embeddable Command Language" by John Ousterhout, Proceedings of the Winter 1990 USENIX Conference, Washing- ton, D.C., January 22-26, 1990.p AUTHOR Don Libes, National Institute of Standards and Technology -- Brian Kenney kenney@hsi.com 3M Health Information Systems Wallingford, CT ------------------------------------------------------------------------------ "It's not innovation... but it's close."