Expect is a utility based on TCL. It's primary use is for building automation into interactive environments such as telnet or ssh based terminal environments.
It provides the ability to enter commands on a command line and interpret the output.
Expect adds many extensions to the Tcl scripting language which simplify scripting interactive applications controlling such hard-to-interact programs such as telnet, ftp, passwd, fsck, rlogin, tip, ssh, and others. Expect/tcl can run a GUI interface or run from the command line. Since Tcl is a full featured programming language, Expect can easily interact with databases, webservers, etc. with intuitive, powerful, and easy-to-anticipate processing.
Expect is in the public domain. There is full support for Linux and Windows.
Overview and history website: http://www.nist.gov/el/msid/expect.cfm
Support and download website: http://expect.sourceforge.net/
FAQs website: http://expect.sourceforge.net/FAQ.html