This is beta release 16 of Expect for Tcl 7.5 and Tk 4.1.  ALPHA AND
BETA RELEASES OF TCL/TK ARE NOT SUPPORTED!

==============================
A couple new things:

There is now an Expect FAQ and home page.  Consider those alpha as
well!  Feedback is encouraged.  You can get to the FAQ from the home
page and vice versa, so you only need to remember one of the links, but here
are both for completeness:

home page: http://www.cme.nist.gov/pub/expect
FAQ:       http://www.cme.nist.gov/pub/expect/FAQ.html

Ok, back to the boring stuff....

You can now use expect_background from Tcl along with all the
Tcl-based event stuff such as "after".  You can also do fun things
such as have "after" actions run while expect is waiting for input.
It's worth comparing the difference between commands such as expect
(which waits in the event loop) and gets (which doesn't).

Incompatibilities
==============================

libexpectk is gone.  Because of the event loop was moved into Tcl,
this is no longer necessary.  Just use the regular Expect library.
This only affects you if are hand-linking.

The name of the static C library now has the extension on the end -
just like Tcl.  This only affects you if are hand-linking.


==============================
Some obvious questions and answers

Nothing in the user interface has changed.  All your old scripts
should run.  Tcl now has commands that replace Expect functionality in
the area of version control and date handling.  I encourage you to use
Tcl's support rather than Expect's for any new scripts that you write.
However, I won't be removing Expect's commands, so don't worry about
having to convert old scripts.

It is my understand that shared/dl libs work.  (I say "it is my
understanding", because my own environment doesn't handle it, sigh.
My system admins tell me that they're working on it.)  So I've had to
guess on some things - in fact, I've talked to a number of people and
I get the feeling that a lot of people are guessing on shared/dl libs.
I have yet to talk to anyone that REALLY understands this stuff (by
"understand", I mean "can write the configure/Makefile portably and
correctly".  So much for my griping.  In theory, the shared/dl support
is pretty much a freebie because Tcl itself provides all the support
for this.  (There is some reorganization that could be done to improve
shared library memory use - I'll get to it eventually - it shouldn't
affect most people.)  Don't send me complaints about shared/dl libs
unless you are *positive* it is something that I am responsible for.
Even if Tcl works and Expect fails, it is likely to be a Tcl error (or
more precisely, a configuration problem that is more appropriately
fixed from the Tcl distribution).  John has noted that there are
problems with this in the Tcl distribution that will be fixed in the
next Tcl release.

For Tcl-package purposes, Expect is called "Expect".  (Duh...)

Expect's multiple interpreter support is minimal.  It should work for
most things, serendipitously.  I haven't spent any time making this
perfect.

No, this release isn't portable to Windows or Mac.  Let me know if
you're seriously interested in a lot of work.  I'm not saying it's not
possible.  It's definitely possible and the porting working at Sun has
made it easier than before.  But it's still not a weekend hack.  Far
from it.

Industrial support for the NT port, would be very helpful.  If you are
interested, either as a student or an industrial sponsor, let me know.

==============================
Building the code
==============================

Expect builds as usual.  (See the INSTALL file for details.)
ALPHA AND BETA RELEASES OF TCL/TK ARE NOT SUPPORTED!

The only significant change is that Expect now has to find the
tclConfig.sh file (and tkConfig.sh if you want).  So if you like to
store Tcl where Expect can't find it, you'll need to use even more
configure flags than you used to.

Shared/dl Expect libraries are built if you configured Tcl for
shared/dl libraries.

All support for earlier versions of Tcl and Tk have been removed from
Expect.  For example, if you're still using Tcl 7.4 (or earlier),
don't bother to install this release.


==============================
And now, back to the same old README....
==============================






--------------------
Introduction
--------------------

This is the README file for Expect, a program that performs programmed
dialogue with other interactive programs.  It is briefly described by
its man page, expect(1).  This directory contains the source and man
page for Expect.

This is Expect 5 for Tcl 7.5.  Tk 4.1 and the Tcl Debugger are also
supported.  If you have Expect 4 scripts, read the CHANGES.4to5 file.

--------------------
Getting Started - The Preferable Way
--------------------

A book on Expect is available from O'Reilly with the title "Exploring
Expect: A Tcl-Based Toolkit for Automating Interactive Applications",
ISBN 1-56592-090-2.

The book is filled with detailed examples and explanations, and is a
comprehensive tutorial to Expect.  The book also includes a tutorial
on Tcl written specifically for Expect users (so you don't have to
read the Expect papers, the debugger paper, Ousterhout's book, or the
man pages).  Exploring Expect is 602 pages.

If you have access to World Wide Web, here are some related URLs:

one-paragraph description (from O'Reilly catalog):
	http://www.ora.com/gnn/bus/ora/item/expect.html
one-page description (from back cover of book):
	http://www.ora.com/gnn/bus/ora/item/expect.desc.html
front cover - picture and description:
	http://www.ora.com/gnn/bus/ora/item/expect.cover.html

To order:
	Via email: order@ora.com
	Via the web: http://www.ora.com/gnn/bus/ora/ordering/index.html
	Via phone (Weekdays 6am-6pm PST): 800-889-9938 or 707-829-0515

Publisher's address: O'Reilly & Associates, Inc.
	             103A Morris Street
	             Sebastopol, CA  95472


O'Reilly also has available very pretty t-shirts with a blown-up
picture of the artwork from the front cover.

--------------------
Getting Started - The Hacker Way
--------------------

While the book is the best way to learn about Expect, it is not
absolutely necessary.  There are man pages after all and there are
numerous articles and papers on Expect.  All of my own papers are in
the public domain and can be received free.  If you are a hacker on a
tight budget, this may appeal to you.  Nonetheless, I think you will
find the book pays for itself very quickly.  It is much more readable
than the man pages, it includes well-written and explained examples,
and it describes everything in the papers as a coherent whole.  The
concepts in the papers actually only make up a small fraction of the
book.

The 1990 USENIX paper (see "Readings" below) is probably the best one
for understanding Expect conceptually.  The 1991 Computing Systems and
the LISA IV papers provide a nice mix of examples.  The only downside
is, the examples in these papers don't actually work anymore - some
aspects (e.g., syntax) of both Expect and Tcl have changed.  The
papers still make interesting reading - just don't study the examples
too closely!  Fortunately, most of the examples from the papers also
accompany this distribution - and all of these are up to date.

For all the details, read the man page.  It is long but you can get
started just by skimming the sections on the following commands:

	spawn		(starts a process)
	send		(sends to a process)
	expect		(waits for output from a process)
	interact	(lets you interact with a process)

To print out the Expect man page, invoke your local troff using the
-man macros, such as either of:

		ptroff -man expect.man
		ditroff -man expect.man

If Expect is installed, you can read the man pages using the "usual"
man commands, such as "man expect".  If not installed, view the man
page on your screen by saying something like:

		nroff -man expect.man | more

Expect uses Tcl as the underlying language for expressing things such
as procedures, loops, file I/O, and arithmetic expressions.  For many
simple scripts, it is not necessary to learn about Tcl.  Just by
studying the examples, you will learn enough Tcl to get by.  But if
you would like to learn more about Tcl or use it in your own
applications, read the Tcl README file which provides pointers to the
extensive Tcl documentation.  Or read Exploring Expect.  Chapter 2 of
Exploring Expect is a Tcl tutorial specifically designed for Expect
users.

An interactive debugger is bundled with Expect.  The debugger has its
own documentation that comes separately.  It is listed in the Readings
below.  Again, it is slightly out of date.  An up-to-date description
of the debugger appears in Chapter 18 of Exploring Expect.  This
chapter also contains additional advice and tips for debugging.

You may get the feeling that the Expect documentation is somewhat
scattered and disorganized.  This was true prior to publication of
Exploring Expect.  The book contains everything you need to know, all
up-to-date, and with examples of every concept.  (The book contains no
references to any of the Expect papers because none are necessary.)

----------------------
Examples
----------------------

This distribution contains many example scripts.  (All of the
substantive examples in the book are included.)  They can be found in
the example directory of this distribution.  The README file in that
directory briefly describes all of the example scripts.  Many of the
more sophisticated examples have man pages of their own.

Other interesting scripts are available separately in the directory
pub/expect/scripts at ftp.cme.nist.gov.  (See below for how to
retrieve these.)  You are welcome to send me scripts to add to this
directory.  A number of Expect scripts are also available in the Tcl
archive, available at ftp://ftp.neosoft.com/pub/tcl.

--------------------
Readings on Expect
--------------------

The implementation, philosophy, and design are discussed in "expect:
Curing Those Uncontrollable Fits of Interaction", Proceedings of the
Summer 1990 USENIX Conference, Anaheim, CA, June 11-15, 1990.

Examples and discussion, specifically aimed at system administrators,
are in "Using expect to Automate System Administration Tasks",
Proceedings of the 1990 USENIX Large Systems Administration Conference
(LISA) IV, Colorado Springs, CO, October 17-19, 1990.

A comprehensive paper of example scripts is "expect: Scripts for
Controlling Interactive Programs", Computing Systems, Vol. 4, No. 2,
University of California Press Journals, 1991.

Regression and conformance testing is discussed in "Regression Testing
and Conformance Testing Interactive Programs", Proceedings of the
Summer 1992 USENIX Conference, San Antonio, TX, June 8-12, 1992.

An explanation of some of the more interesting source code to an early
version of Expect is in Chapter 36 ("Expect") of "Obfuscated C and
Other Mysteries", John Wiley & Sons, ISBN 0-471-57805-3, January 1993.

A paper on connecting multiple interactive programs together using
Expect is "Kibitz - Connecting Multiple Interactive Programs
Together", Software - Practice & Experience, Vol. 23, No. 5, May 1993.

The debugger is discussed in "A Debugger for Tcl Applications",
Proceedings of the 1993 Tcl/Tk Workshop, Berkeley, CA, June 10-11,
1993.

Using Expect with Tk is described in the paper "X Wrappers for
Non-Graphic Interactive Programs", Proceedings of Xhibition '94, San
Jose, CA, June 20-24, 1994.

Simple techniques to allow secure handling of passwords in background
processes are covered in "Handling Passwords with Security and
Reliability in Background Processes", Proceedings of the 1994 USENIX
LISA VIII Conference, San Diego, CA, September 19-23, 1994.

--------------------
How to Get the Latest Version of Expect or the Readings
--------------------

Expect may be ftp'd as pub/expect/expect.tar.Z from ftp.cme.nist.gov.
Request email delivery by mailing to "library@cme.nist.gov".  The
contents of the message should be (no subject line) "send
pub/expect/expect.tar.Z".  (Development versions of Expect may
occasionally be made available as alpha.tar.Z in the same directory.)

Once you have retrieved the system, read the INSTALL file.  The papers
mentioned above can be retrieved separately as:

 pub/expect/doc/seminal.ps.Z         (USENIX '90 - Intro and Implementation)
 pub/expect/doc/sysadm.ps.Z            (LISA '90 - System Administration)
 pub/expect/doc/scripts.ps.Z  (Comp. Systems '91 - Overview of Scripts)
 pub/expect/doc/regress.ps.Z         (USENIX '92 - Testing)
 pub/expect/doc/kibitz.ps.Z            (SP&E '93 - Automating Multiple
					Interactive Programs Simultaneously)
 pub/expect/doc/tcl-debug.ps.Z       (Tcl/Tk '93 - Tcl/Tk Debugger)
 pub/expect/doc/expectk.ps.Z      (Xhibition '94 - Using Expect with Tk)
 pub/expect/doc/bgpasswd.ps.Z          (LISA '94 - Passwds in Background Procs)
 pub/expect/doc/chargraph.ps.Z         (SP&E '96 - Testing and Automation
					of Character Graphic Applications)

The book "Exploring Expect" is described in more detail earlier in
this file.

The book "Obfuscated C and Other Mysteries" is not on-line but is
available in bookstores or directly from the publisher (Wiley).

Overhead transparencies I've used at conferences are also available in
the same way as the papers themselves.  The transparencies are sketchy
and not meant for personal education - however if you are familiar
with Expect and just want to give a short talk on it to your
colleagues, you may find the transparencies useful.  They vary in
length from 15 to 20 minutes in length.  These are:

  pub/expect/seminal-talk.ps.Z    (USENIX '90 - Intro and Implementation)
  pub/expect/sysadm-talk.ps.Z       (LISA '90 - System Administration)
  pub/expect/regress-talk.ps.Z    (USENIX '92 - Testing)
  pub/expect/tcl-debug-talk.ps.Z  (Tcl/Tk '93 - Tcl/Tk Debugger)
  pub/expect/expectk-talk.ps.Z (Xhibition '94 - Expect + Tk = Expectk)
  pub/expect/bgpasswd-talk.ps.Z     (LISA '94 - Passwords in the Background)

All of the documents are compressed PostScript files and should be
uncompressed and sent to a PostScript printer.  The documents are
intended for printing at 8.5"x11" and may fail on some ISO A4
printers.  According to Hans Mayer <Hans.Mayer@gmd.de>, you can make
them A4-able by searching for "FMVERSION" and changing the next line
from:

	1 1 0 0 612 792 0 1 13 FMDOCUMENT
to:
	1 1 0 0 594 841 0 1 13 FMDOCUMENT


--------------------
Using Expect with and without Tcl and/or Tk.
--------------------

The usual way of using Expect is as a standalone program with Tcl as
the control language.  Since you may already have Tcl, it is available
separately.  Tcl may be retrieved as pub/expect/tcl.tar.Z in the same
way as described above for Expect.  When new releases of Tcl appear, I
will try to check them out for Expect as soon as possible.  If you
would like to get the newest Tcl release without waiting, ftp it from
ftp.smli.com (directory pub/tcl).

Expect may also be built using the Tk library, a Tcl interface to the
X Window System.  Tk is available in the same way as Tcl.

It is possible to embed the Expect/Tcl core and optionally Tk in your
own C programs.  This is described in libexpect(3).

Expect can also be used from a C or C++ program without Tcl.  This is
described in libexpect(3).  While I consider this library to be easy
to use, the standalone Expect program is much, much easier to use than
working with the C compiler and its usual edit, compile, debug cycle.
Unlike typical programming, most of the debugging isn't getting the C
compiler to accept your programs - rather, it is getting the dialogue
correct.  Also, translating scripts from Expect to C is usually not
necessary.  For example, the speed of interactive dialogues is
virtually never an issue.  So please try 'expect' first.  It is a more
appropriate tool than the library for most people.

--------------------
Systems Supported
--------------------

I do not know of any UNIX systems on which Expect will not run.
Systems which do not support select or poll can use Expect, but
without the ability to run multiple processes simultaneously.  I am
willing to work with you to complete a port.

Before sending me changes, please download or verify that you have the
latest version of Expect (see above).  Then send me a "diff -c" along
with a suitable English explanation.  If your diff involves something
specific to a machine, give me diffs for configure.in as well or give
me a hint about when the diffs should be done so I can write the
configure support myself.  Also please include the version of the OS
and whether it is beta, current, recent, or totally out-of-date and
unsupported.

--------------------
Installing Expect
--------------------

Expect comes with a configure script that provides for an automated
installation.  I believe you will find that Expect is very easy to
install.  (Tcl and Tk, too.)

For more information, read the INSTALL file.

--------------------
Support from Don Libes or NIST
--------------------

Although I can't promise anything in the way of support, I'd be
interested to hear about your experiences using it (good or bad).  I'm
also interested in hearing bug reports and suggestions for improvement
even though I can't promise to implement them.

If you send me a bug, fix, or question, include the version of Expect
(as reported by expect -d), version of Tcl, and name and version of
the OS that you are using.  Before sending mail, it may be helpful to
verify that your problem still exists in the latest version.  You can
check on the current release and whether it addresses your problems by
retrieving the latest HISTORY file (see "History" above).


Awards, love letters, and bug reports may be sent to:

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

I hereby place this software in the public domain.  NIST and I would
appreciate credit if this program or parts of it are used.

Design and implementation of this program was funded primarily by
myself.  Funding contributors include the NIST Automated Manufacturing
Research Facility (funded by the Navy Manufacturing Technology
Program), the NIST Scientific and Technical Research Services, the
ARPA Persistent Object Bases project and the Computer-aided
Acquisition and the Logistic Support (CALS) program of the Office of
the Secretary of Defense.

Especially signicant contributions were made by John Ousterhout, Henry
Spencer, and Rob Savoye.  See the HISTORY file for others.

--------------------
Support for Don Libes or NIST
--------------------

NIST accepts external funding and other resources (hardware, software,
and personnel).  This can be a fine way to work more closely with NIST
and encourage particular areas of research.

Funding can be earmarked for specific purposes or for less-specific
purposes.  For example, if you simply like the work I do, you can
contribute directly to my funding which will reduce the amount of time
I have to spend writing proposals and submitting them to other people
for funding on my own.

I can also participate in the NIST Fellows program allowing me to
spend several months to a year working directly with your company and
potentially even at your location.  I am also interested in returning
to an academic program.  I presently have an MS and am hunting for
Ph.D. topics and advisors.  Let me know if you have ideas or are
interested in being my advisor.

--------------------
Commercial Support, Classes
--------------------

Several companies provide commercial support for Expect.  If your
company has a financial investment in Expect or you wish to be assured
of continuing support for Expect, you can buy a support contract this
way.  These companies currently include:

Cygnus Support
1937 Landings Drive
Mountain View, CA  94043
+1 (415) 903-1400
info@cygnus.com
http://www.cygnus.com

Computerized Processes Unlimited (CPU)
4200 S. I-10 Service Rd., Suite 205
Metairie, LA  70006
+1 (504) 889-2784
info@cpu.com
http://www.cpu.com
http://www.cpu.com/cpu/expect.htm (Expect class page)

CPU provides Expect support and also Expect classes.  Contact them for
more information.

Neither NIST nor I have any financial relationship with these
companies.


