URL
https://opencores.org/ocsvn/or1k_old/or1k_old/trunk
Subversion Repositories or1k_old
[/] [or1k_old/] [trunk/] [insight/] [expect/] [README] - Rev 1782
Compare with Previous | Blame | View Log
NOTE: ALPHA AND BETA RELEASES OF TCL/TK ARE NOT SUPPORTED!--------------------Introduction--------------------This is the README file for Expect, a program that performs programmeddialogue with other interactive programs. It is briefly described byits man page, expect(1). This directory contains the source and manpage for Expect.This is Expect 5 for Tcl 7.5, 7.6, and 8.0. Tk 4.1, 4.2, 8.0 and theTcl Debugger are also supported. Significant changes and other newscan be found in the NEWS file.The Expect home page is: http://expect.nist.govThe Expect FAQ is: http://expect.nist.gov/FAQ.html--------------------Getting Started - The Preferable Way--------------------A book on Expect is available from O'Reilly with the title "ExploringExpect: A Tcl-Based Toolkit for Automating Interactive Applications",ISBN 1-56592-090-2.The book is filled with detailed examples and explanations, and is acomprehensive tutorial to Expect. The book also includes a tutorialon Tcl written specifically for Expect users (so you don't have toread the Expect papers, the debugger paper, Ousterhout's book, or theman pages). Exploring Expect is 602 pages.--------------------Getting Started - The Hacker Way--------------------While the book is the best way to learn about Expect, it is notabsolutely necessary. There are man pages after all and there arenumerous articles and papers on Expect. All of my own papers are inthe public domain and can be received free. If you are a hacker on atight budget, this may appeal to you. Nonetheless, I think you willfind the book pays for itself very quickly. It is much more readablethan the man pages, it includes well-written and explained examples,and it describes everything in the papers as a coherent whole. Theconcepts in the papers actually only make up a small fraction of thebook.The 1990 USENIX paper (see "Readings" below) is probably the best onefor understanding Expect conceptually. The 1991 Computing Systems andthe LISA IV papers provide a nice mix of examples. The only downsideis, the examples in these papers don't actually work anymore - someaspects (e.g., syntax) of both Expect and Tcl have changed. Thepapers still make interesting reading - just don't study the examplestoo closely! Fortunately, most of the examples from the papers alsoaccompany this distribution - and all of these are up to date.For all the details, read the man page. It is long but you can getstarted 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.manditroff -man expect.manIf Expect is installed, you can read the man pages using the "usual"man commands, such as "man expect". If not installed, view the manpage on your screen by saying something like:nroff -man expect.man | moreExpect uses Tcl as the underlying language for expressing things suchas procedures, loops, file I/O, and arithmetic expressions. For manysimple scripts, it is not necessary to learn about Tcl. Just bystudying the examples, you will learn enough Tcl to get by. But ifyou would like to learn more about Tcl or use it in your ownapplications, read the Tcl README file which provides pointers to theextensive Tcl documentation. Or read Exploring Expect. Chapter 2 ofExploring Expect is a Tcl tutorial specifically designed for Expectusers.An interactive debugger is bundled with Expect. The debugger has itsown documentation that comes separately. It is listed in the Readingsbelow. Again, it is slightly out of date. An up-to-date descriptionof the debugger appears in Chapter 18 of Exploring Expect. Thischapter also contains additional advice and tips for debugging.You may get the feeling that the Expect documentation is somewhatscattered and disorganized. This was true prior to publication ofExploring Expect. The book contains everything you need to know, allup-to-date, and with examples of every concept. (The book contains noreferences to any of the Expect papers because none are necessary.)----------------------Examples----------------------This distribution contains many example scripts. (All of thesubstantive examples in the book are included.) They can be found inthe example directory of this distribution. The README file in thatdirectory briefly describes all of the example scripts. Many of themore sophisticated examples have man pages of their own.Other interesting scripts are available separately in the directoryhttp://expect.nist.gov/scripts/ (ftpable asftp://ftp.nist.gov/mel/div826/subject/expect/scripts). (See below forhow to retrieve these.) You are welcome to send me scripts to add tothis directory. A number of Expect scripts are also available in theTcl 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 theSummer 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 forControlling Interactive Programs", Computing Systems, Vol. 4, No. 2,University of California Press Journals, 1991.Regression and conformance testing is discussed in "Regression Testingand Conformance Testing Interactive Programs", Proceedings of theSummer 1992 USENIX Conference, San Antonio, TX, June 8-12, 1992.An explanation of some of the more interesting source code to an earlyversion of Expect is in Chapter 36 ("Expect") of "Obfuscated C andOther Mysteries", John Wiley & Sons, ISBN 0-471-57805-3, January 1993.A paper on connecting multiple interactive programs together usingExpect is "Kibitz - Connecting Multiple Interactive ProgramsTogether", 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 forNon-Graphic Interactive Programs", Proceedings of Xhibition '94, SanJose, CA, June 20-24, 1994.Simple techniques to allow secure handling of passwords in backgroundprocesses are covered in "Handling Passwords with Security andReliability in Background Processes", Proceedings of the 1994 USENIXLISA VIII Conference, San Diego, CA, September 19-23, 1994.More publications can be found in the Expect home page (see elsewhere).--------------------How to Get the Latest Version of Expect or the Readings--------------------Expect may be ftp'd as mel/div826/subject/expect/expect.tar.gz fromexpect.nist.gov. (Yes, the URL is much shorter:http://expect.nist.gov/expect.tar.Z) Request email delivery by mailingto "library@cme.nist.gov". The contents of the message should be (nosubject line) "send pub/expect/expect.tar.Z".Once you have retrieved the system, read the INSTALL file. The papersmentioned above can be retrieved separately (from the same directorieslisted above) as:doc/seminal.ps.Z (USENIX '90 - Intro and Implementation)doc/sysadm.ps.Z (LISA '90 - System Administration)doc/scripts.ps.Z (Comp. Systems '91 - Overview of Scripts)doc/regress.ps.Z (USENIX '92 - Testing)doc/kibitz.ps.Z (SP&E '93 - Automating MultipleInteractive Programs Simultaneously)doc/tcl-debug.ps.Z (Tcl/Tk '93 - Tcl/Tk Debugger)doc/expectk.ps.Z (Xhibition '94 - Using Expect with Tk)doc/bgpasswd.ps.Z (LISA '94 - Passwds in Background Procs)doc/chargraph.ps.Z (SP&E '96 - Testing and Automationof Character Graphic Applications)The book "Exploring Expect" is described in more detail earlier inthis file.The book "Obfuscated C and Other Mysteries" is not on-line but isavailable in bookstores or directly from the publisher (Wiley).Overhead transparencies I've used at conferences are also available inthe same way as the papers themselves. The transparencies are sketchyand not meant for personal education - however if you are familiarwith Expect and just want to give a short talk on it to yourcolleagues, you may find the transparencies useful. They vary inlength from 15 to 20 minutes in length. These are:doc/seminal-talk.ps.Z (USENIX '90 - Intro and Implementation)doc/sysadm-talk.ps.Z (LISA '90 - System Administration)doc/regress-talk.ps.Z (USENIX '92 - Testing)doc/tcl-debug-talk.ps.Z (Tcl/Tk '93 - Tcl/Tk Debugger)doc/expectk-talk.ps.Z (Xhibition '94 - Expect + Tk = Expectk)doc/bgpasswd-talk.ps.Z (LISA '94 - Passwords in the Background)All of the documents are compressed PostScript files and should beuncompressed and sent to a PostScript printer. The documents areintended for printing at 8.5"x11" and may fail on some ISO A4printers. According to Hans Mayer <Hans.Mayer@gmd.de>, you can makethem A4-able by searching for "FMVERSION" and changing the next linefrom:1 1 0 0 612 792 0 1 13 FMDOCUMENTto: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 asthe control language. Since you may already have Tcl, it is availableseparately. Tcl may be retrieved as tcl.tar.Z in the same way asdescribed above for Expect. When new releases of Tcl appear, I willtry to check them out for Expect as soon as possible. If you wouldlike to get the newest Tcl release without waiting, ftp it fromftp.smli.com (directory pub/tcl).Expect may also be built using the Tk library, a Tcl interface to theX Window System. Tk is available in the same way as Tcl.It is possible to embed the Expect/Tcl core and optionally Tk in yourown C programs. This is described in libexpect(3).Expect can also be used from a C or C++ program without Tcl. This isdescribed in libexpect(3). While I consider this library to be easyto use, the standalone Expect program is much, much easier to use thanworking with the C compiler and its usual edit, compile, debug cycle.Unlike typical programming, most of the debugging isn't getting the Ccompiler to accept your programs - rather, it is getting the dialoguecorrect. Also, translating scripts from Expect to C is usually notnecessary. For example, the speed of interactive dialogues isvirtually never an issue. So please try 'expect' first. It is a moreappropriate 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, butwithout the ability to run multiple processes simultaneously. I amwilling to work with you to complete a port.Before sending me changes, please download or verify that you have thelatest version of Expect (see above). Then send me a "diff -c" alongwith a suitable English explanation. If your diff involves somethingspecific to a machine, give me diffs for configure.in as well or giveme a hint about when the diffs should be done so I can write theconfigure support myself. Also please include the version of the OSand whether it is beta, current, recent, or totally out-of-date andunsupported.--------------------Installing Expect--------------------Expect comes with a configure script that provides for an automatedinstallation. I believe you will find that Expect is very easy toinstall. (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 beinterested to hear about your experiences using it (good or bad). I'malso interested in hearing bug reports and suggestions for improvementeven 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 ofthe OS that you are using. Before sending mail, it may be helpful toverify that your problem still exists in the latest version. You cancheck on the current release and whether it addresses your problems byretrieving the latest HISTORY file (see "History" above).Awards, love letters, and bug reports may be sent to:Don LibesNational Institute of Standards and TechnologyBldg 220, Rm A-127Gaithersburg, MD 20899(301) 975-3535libes@nist.govI hereby place this software in the public domain. NIST and I wouldappreciate credit if this program or parts of it are used.Design and implementation of this program was funded primarily bymyself. Funding contributors include the NIST Automated ManufacturingResearch Facility (funded by the Navy Manufacturing TechnologyProgram), the NIST Scientific and Technical Research Services, theARPA Persistent Object Bases project and the Computer-aidedAcquisition and the Logistic Support (CALS) program of the Office ofthe Secretary of Defense.Especially signicant contributions were made by John Ousterhout, HenrySpencer, 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 NISTand encourage particular areas of research.Funding can be earmarked for specific purposes or for less-specificpurposes. For example, if you simply like the work I do, you cancontribute directly to my funding which will reduce the amount of timeI have to spend writing proposals and submitting them to other peoplefor funding on my own.I can also participate in the NIST Fellows program allowing me tospend several months to a year working directly with your company andpotentially even at your location. I am also interested in returningto an academic program. I presently have an MS and am hunting forPh.D. topics and advisors. Let me know if you have ideas or areinterested in being my advisor.--------------------Commercial Support, Classes--------------------Several companies provide commercial support for Expect. If yourcompany has a financial investment in Expect or you wish to be assuredof continuing support for Expect, you can buy a support contract thisway. These companies currently include:Cygnus Support1937 Landings DriveMountain View, CA 94043+1 (415) 903-1400info@cygnus.comhttp://www.cygnus.comComputerized Processes Unlimited (CPU)4200 S. I-10 Service Rd., Suite 205Metairie, LA 70006+1 (504) 889-2784info@cpu.comhttp://www.cpu.comhttp://www.cpu.com/cpu/expect.htm (Expect class page)CPU provides Expect support and also Expect classes. Contact them formore information.Neither NIST nor I have any financial relationship with thesecompanies.
