Version 14 of Most programmers don't know what Expect can do for them

Updated 2004-03-30 22:42:37

This is the theme of "Expect exceeds expectations" (see the developerworks article at: [L1 ]): even most active Expect programmers are aware of only a fraction of its capabilities.

First, they don't realize that Expect is a proper superset of Tcl, and therefore can do everything Tcl can. Moreover, they're not aware that Tcl is a quite capable general-purpose programming language.

They also are not aware of the relation between Tk and Expect, so don't realize how easy it is to add a GUI to existing Expect scripts.

Expect extends Tcl in three principal ways:

  • with pseudo-terminal (pty) management
  • with debugging facilities
  • with a command language for "challenge"-response dialogues.

In broad terms, few programmers realize the elegance of integration of pty management into Tcl's framework of event-oriented channels. [Much more explanation.]


interact is one of Expect's wonders.


Usability notice: The referenced developerWorks article contains what appear to be hyperlinks to a discussion forum. They are not hyperlinks. They are javascript directives. So, turn on your javascript, and forget about any "open in a new tab" option you may be used to when something looks like a link.

Usability followup: Once you navigate the maze above and actually reach the discussion forum, it is completely unusable. Do not waste your time. Just read the article, then go home.


Expect is a superset of Tcl? That's shocking news to me. Then how come we program in Tcl instead of Expect? Such play on words can have a mind-boggling effect on newbies.

Luciano, can we do this in clt? I don't understand whether you have an other-than-rhetorical question.

No, my dear IP number gumshoe. The wording has confused me indeed. I always thought that Expect was a Tcl application, or a Tcl subset in other words. Just tell us what "superset" means here, edit (delete) my clueless questioning and we're good. ;-)


Category Expect