Chapter 6. Expect

Expect, written by Don Libes, is a tool for communicating with interactive programs. Expect is not part of the core Tcl/Tk package, but can be obtained for free at http://expect.nist.gov. This chapter covers Version 5.25.0.

Expect can automate tasks that would normally require a user to interactively communicate with a program. Expect is a Tcl interpreter extended with additional commands. It can be run as the standalone programs expect and expectk or used with other Tcl language extensions.

Expect was the first major Tcl-based application. This chapter describes the features that Expect adds to the Tcl language.

Get Tcl/Tk in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.