The Expect Home Page

This page describes Expect and several other tools that can be found at this site. First, Expect . . .


Introduction

Expect is a tool for automating interactive applications such as telnet, ftp, passwd, fsck, rlogin, tip, etc. Expect really makes this stuff trivial. Expect is also useful for testing these same applications. And by adding Tk, you can also wrap interactive applications in X11 GUIs.

Expect can make easy all sorts of tasks that are prohibitively difficult with anything else. You will find that Expect is an absolutely invaluable tool - using it, you will be able to automate tasks that you've never even thought of before - and you'll be able to do this automation quickly and easily.

Ok - enough of the hype. More information on Expect is available in the following documents:


Obtaining Expect

You can get Expect and the examples from expect.nist.gov as expect.tar.Z or expect.tar.gz. The gz file is preferrable simply because it is quicker to download. However, if you have no idea what to do with a gz file once you've got it, just transfer the Z version of the distribution. Then, at the command line, type:

 uncompress expect.tar.Z
 tar -xvf expect.tar

This will create a directory containing the Expect distribution. Change to that directory and read the README file.

Note 1: Expect requires Tcl. If you don't already have Tcl, you can get it as tcl.tar.Z or gz. To install Tcl, just mimic the instructions as for Expect.

Note 2: If you want to download Expect (or Tcl) without using a web browser, you will need to know the ftp-style URLs. Yes, they're a lot longer and clumsier than the web-style URLs. The ftp URLs are:

ftp://ftp.nist.gov/mel/div826/subject/expect/expect.tar.gz (or .Z)
ftp://ftp.nist.gov/mel/div826/subject/tcl.tar.gz (or .Z)

Obtaining the examples

The distribution contains many example scripts, including many well-known scripts such as kibitz, rftp (recursive ftp), passmass, autoexpect and the delicious beer script. All of the substantive examples in the book are included and many of them have man pages themselves.

To obtain the examples, follow the directions for obtaining Expect (above). Once you have received and unpacked the distribution, you can find the examples in the example directory.


Links to related information

The following are some other particularly worthwhile Expect-related links.

Here are a couple links to pages describing projects written using Expect.

More about Exploring Expect

"Exploring Expect" is an excellent resource for learning and using Expect. (Pub: O'Reilly, ISBN 1-56592-090-2) The book contains hundreds of examples and also includes a tutorial on Tcl. Exploring Expect is 602 pages.

NIST policy is to avoid endorsements for commercial products or organizations. Hence this page provides no link for the publisher or any further information about how to obtain the book.

Articles, Papers, and Chapters on Expect


History

Expect was conceived of in September, 1987. The bulk of version 2 was designed and written between January and April, 1990. Minor evolution occurred after that until Tcl 6.0 was released. At that time (October, 1991) approximately half of Expect was rewritten for version 3. See the HISTORY file for more information. The HISTORY file is included with the Expect distribution.

Around January 1993, an alpha version of Expect 4 was introduced. This included Tk support as well as a large number of enhancements. A few changes were made to the user interface itself, which is why the major version number was changed. A production version of Expect 4 was released in August 1993.

In October 1993, an alpha version of Expect 5 was released to match Tcl 7.0. A large number of enhancements were made, including some changes to the user interface itself, which is why the major version number was changed (again). The production version of Expect 5 released in March '94.

There are important differences between Expect 3, 4, and 5. See the CHANGES.* files in the distribution if you want to read about the differences. Expect 4 has ceased further development and is not supported. However, if for some reason you want the old code, it is available from pub/expect/old as described above.

The Expect book became available in January '95. It describes Expect 5 as it is today, rather than how Expect 5 was when it was originally released. Thus, if you have not upgraded Expect since before getting the book, you should upgrade now.

Historical notes on Tcl and Tk according to John Ousterhout

I got the idea for Tcl while on sabbatical leave at DEC's Western Research Laboratory in the fall of 1987. I started actually implementing it when I got back to Berkeley in the spring of 1988; by summer of that year it was in use in some internal applications of ours, but there was no Tk. The first external releases of Tcl were in 1989, I believe. I started implementing Tk in 1989, and the first release of Tk was in 1991.


Other useful software at this site


Even more links

The following links have nothing specifically to do with Expect but may be significant in their value to Expect users nonetheless:

Books

FAQs (search)

Overviews/Intros/Tutorials

Man Pages

Conferences

Articles/Papers

Tcl/Tk References on the Web

Even more comprehensive indices to what's out there including links to extensions, applications, ftp sites, etc.

Miscellaneous

Pages that are particularly worthwhile but don't fall in the preceding categories.
Names of companies and products, and links to commercial pages are provided in order to adequately specify procedures and equipment used. In no case does such identification imply recommendation or endorsement by the National Institute of Standards and Technology, nor does it imply that the products are necessarily the best available for the purpose.

Last edited: Thu Oct 16 15:44:25 EDT 1997 by Don Libes