| |||||||||||
What is Expect / a sample Posted by admin (Graham Ellis), 7 October 2002 Expect is an extension to Tcl which allows you to automate processes such as telnet and FTP by "mimicing" the user's input in a terminal window. You use the spawn command to spawn a telnet (or FTP, or whatever) process, you use send (or exp_send if you're also using Tk) to send some text as if it was typed, and then you wait for a specific input pattern to come back via the expect command.Here's an example that does a remote ls listing; enter host computer name into an entry box, click on the "go" button, and you get a listing of all files in the trainee home directory on that system. Code:
This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
Other Forum Posts Follow us on ... | ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |