- Developer Tools
Jeff Hobbs, January 31, 2006
Not too long ago, there was a binary distributed with ActiveTcl and the Tcl Dev Kit called expect. It allowed one to write Tcl scripts that made use of a collection of functions that were extremely handy for automating tasks which weren't otherwise easy to automate. A good example of this kind of task is running software test suites automatically.
In recent versions of Tcl and the TDK, the executable is nowhere to be found. Naturally, this brings up the question of where it went.
Quite simply, it underwent a bit of a transformation. Rather than being a separate executable, it is now a library that you can use in Tcl scripts, and execute the script with tclsh or wish. Simply include the line:
package require Expect
In your Tcl source file before using expect or exp_send and related commands, and your script will work when run with tclsh or wish.
Category: tclSHARE THIS: