Exercises, examples and other material relating to training module T211. This topic is presented on public courses
Learning to program in Tcl,
Tcl Basics
Tcl Programming - The Tcl programming language, and Expect
This course covers the fundamentals of the Tcl
programming language. You'll learn about Tcl ... http://www.wellho.net/course/tbfull.html [course] |
Learning to Program in Tcl - The Tcl programming language, and Expect
This course covers the fundamentals of the Tcl
programming language. You'll learn ... http://www.wellho.net/course/tlfull.html [course] |
Hot off the presses from the last couple of days - a check list (and a couple of "Gotcha" notes) concerning the installation of Tcl and Expect on a Solaris ... http://www.wellho.net/mouth/1174_Ins ... klist.html [short article] |
Do you need to set up and maintain a whole load of accounts for users on your web server - giving them each their own area of the LAMP server, log in ... http://www.wellho.net/solutions/php-a-we ... tasks.html [longer article] |
I've just noticed on the Activestate site that "the ActiveTcl distribution now includes Expect for Windows. A license is no longer required ....". At ... http://www.wellho.net/mouth/435_Expe ... ndows.html [short article] |
#!/usr/bin/expect
# Simple Expect program - no error checking, just run a series of statements
puts "Getting log file from otter"
spawn ftp
expect ... http://www.wellho.net/resources/ex.php4?item=t211/ftp1 [code sample] |
Programming in Expect can be very different (and more challenging) than conventional programming. Rather than write code (structured, if you like) through ... http://www.wellho.net/mouth/1173_Che ... iners.html [short article] |
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 courses
Learning to program in Tcl,
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) |
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.
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 700 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.