Expect is a Tcl extension that's heavily used by perhaps a third of our trainees. If you have an application that's designed for a human user, but you want to run it automatically, expect lets you mimic the human actions via a series of send and expect commands.
This topic is presented on public course
Tcl Basics
Examples from our training material
| e1 | Simplest ping check via expect |
| e2 | Ping via expect, echo back a value from the report |
| e3 | expect - do not grab indeterminate |
| ftp1 | First Expect example |
| ftp2 | Expect with some error checking and decisions |
| linksandimages | Grab a web page, report all links and images |
| plet.exp | Expect for Windows - ping a host and guess its distance from you |
| weblinks | Grab a web page and report all links |
| wuff | Expecting from a list (regular expression) |
| yap | Expecting from a list (expect block) |
Specialist books
Opentalk forum discussions related to this topic
asking for expect which used to interact programUsing expect with tcl 8 3 5 0 2Processing output after Spawning in Expecthelp with redirectioning outputWhat is Expect a sampleWeb Front TCL Expect Telnet BackendReading from the expect out bufferReading from Expect out bufferHow can I kill process Id s from within quot Expect quotExpect for WindowsCan I combine Expect and TkAlmost same Problem
Pictures
Tcl and Expect - a great way to handle interaction
Background information
Some modules are
available for download as a sample of our material or under an
Open Training Notes License for free download from
http://www.training-notes.co.uk.
Topics covered in this module
Sample problems.
A regular task.
A solution.
Software testing.
A possible solution.
What else is Expect?.
Expect commands.
spawn, expect and send.
More on the expect command.
Not wanting to echo what you expected?.
Not knowing what to expect?.
Variables set by expect.
Expect patterns.
Running Expect on Windows platforms.
Course links
The following web pages are used as references / examples in this module
[
Link] Expect for Windows NT
(at http://bmrc.berkeley.edu/people/chaffee/expectnt.html)
We check these links from time to time with a spider written in PHP. Latest full check was on Saturday, 12th June 2004. Titles are extracted from the web pages listed.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our
Listing and schedule page.
Well House Consultants specialise in training courses in
Tcl/Tk, Expect,
Python,
Perl,
PHP, and
MySQL. We run
Private Courses throughout the UK (and beyond for longer courses), and
Public Courses at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if
you live in a different
country or continent to us.
We have a technical library of over 600 books on the subjects on which we teach.
These books are available for reference at our training centre. Also
available is the Opentalk
Forum for discussion of technical questions.