This file is INSTALL. It contains installation instructions for Expect. If you are installing on a single architecture, or are just trying Expect out to see whether it's worth installing, follow the Simple Installation below. If you are installing Expect on multiple architectures or the "Simple Installation" instructions are not sufficient, see "Sophisticated Installations" below. -------------------- Simple Installation -------------------- Run "./configure". This will generate a Makefile (from a prototype called "Makefile.in") appropriate to your system. Edit the Makefile and change any definitions as appropriate for your site. All the definitions you are likely to want to change are clearly identified and described at the beginning of the file. Run "make expect". This will build a stand-alone Expect program which you can then experiment with. To build everything, run "make". This will build "expectk" (Expect with Tk) as well as libraries for embedding Expect with Tcl (libexptcl.a) and Tk (libexptk.a) in your own programs. "make install" will install Expect and optionally Expectk and the libraries if you have built them. A handful of people running "pure" 4.2BSD systems have noted that expect fails to link due to lack of getopt and vprintf. You can get these from uunet or any good archive site. -------------------- Expect scripts included in the "example" directory -------------------- kibitz - lets two people control a program at the same time. Lots of uses. I.e., You can help another person remotely. Can run an editor and log a transcript of a conversation. See man page or SP&E paper. rogue.exp - finds a good game of rogue. chess.exp - has two chess games play each other. autopasswd - runs passwd non-interactively (you must be root). passmass - sets passwd on many machines simultaneously. timed-read - a timed read for the shell lpunlock - unhangs a printer which says it is "waiting for lock". dvorak - dvorak keyboard weather - retrieves weather forecasts. timed-run - run a program for only a given amount of time. rftp - recursive ftp (assumes UNIX-style ftpd at other end). archie - mails back response after talking to archie ftp-catalog. gethostbyaddr - translates internet address to name (with a higher success rate than nslookup). Easier to use, too. ftp-rfc - retrieve a DoD RFC from uunet via anonymous ftp robohunt - plays the game of hunt (from Berkeley) It's more of a wild player than good, but amusing to watch. Fun to throw against people who don't know about it. rlogin-cwd - rlogin giving you same current working directory To run, for example, chess.exp, type: expect chess.exp If expect is installed and your system supports the #! magic you can invoke it as just: chess.exp Each of these examples necessarily depends upon other binaries in the system. For example, chess.exp depends upon the "usual" UNIX chess program being present. If any of these programs are different, it may cause the associated script to misbehave. Please use the ".exp" extension on scripts that might otherwise have names that could be confused with the real program, such as "rogue.exp". Scripts that have unique names do not need the extension, such as "rftp". -------------------- Sample Expectk scripts included in the example directory -------------------- xpstat - provide an X window front end to the xpilot game. -------------------- Sample C and C++ programs that use libexpect.a included in the example directory -------------------- chesslib.c - same thing as chess.exp, but in C. chesslib2.c - ditto, but uses popen and stream-style I/O. chesslib++.c - ditto, but for C++. You may change the value of CC or CPLUSPLUS in the Makefile, to compile under gcc or other compilers. However, you may have to edit the lines defining where the libraries are. -------------------- Sophisticated Installations -------------------- The following instructions provide some suggestions for handling complex installations. -------------------- Multiple-Architecture Installation -------------------- You might want to compile a software package in a different directory from the one that contains the source code. Doing this allows you to compile the package for several architectures simultaneously from the same copy of the source code and keep multiple sets of object files on disk. To compile the package in a different directory from the one containing the source code, you must use a version of make that supports the VPATH variable. GNU make and most other recent make programs can do this. cd to the directory where you want the object files and executables to go and run configure. configure automatically checks for the source code in the directory that configure is in and in .. If configure reports that it cannot find the source code, run configure with the option --srcdir=dir, where dir is the directory that contains the source code. -------------------- Changing Defaults -------------------- Some of the defaults in "configure" can be overridden by environment variables. This is a convenience intended for environments that likely affect any program that you configure and install. The following variables are supported: CC C compiler program. Default is `cc', or `gcc' if `gcc' is in your PATH. INSTALL Program to use to install files. Default is `install' if you have it, `cp' otherwise. These settings can also be given on the command line. For example, you could tell configure about a particularly C compiler from a Bourne-compatible shell as follows: CC='gcc -traditional' DEFS=-D_POSIX_SOURCE