blank.gif (43 bytes)

Church Of The
Swimming Elephant

Index | Description | Usage | Options | Variables | Hints | Bulletproof

Advanced Programming in Expect:
A Bulletproof Interface

Using The send_expect Procedure

Once the interface has been initialized using send_expect_init, and a process has been spawned, it is ready to be used with the syntax:

send_expect id command;
id = the spawn id of the session on which to send the command, and 
command = the entire command string including the terminating carriage-return, if any. 
This syntax, and the implementation of the expression-action lists, support multiple-session applications. 

The examples provided in this article are simple examples but with more attention to detail, and where warranted a complete implementation is provided as an example.  The send_expect procedure usually replaces only two lines of code in an existing system.

The full syntax for properly using the interface is actually:

  if { [send_expect $id $command] != 0} {
   ## handle your error here


Setting Up The Interface
Using The send_expect Procedure
How It Works
Moving Window Snapshot Diagnostics
Controlling The Behavior Of The Interface


Protect yourself from cyberstalkers, identity thieves, and those who would snoop on you.
Stop spam from invading your inbox without losing the mail you want. We give you more control over your e-mail than any other service.
Block popups, ads, and malicious scripts while you surf the net through our anonymous proxies.
Participate in Usenet, host your web files, easily send anonymous messages, and more, much more.
All private, all encrypted, all secure, all in an easy to use service, and all for only $5.95 a month!

Service Details

Have you gone to church today?
All pages ©1999, 2000, 2001, 2002, 2003 Church of the Swimming Elephant unless otherwise stated
Church of the Swimming Elephant©1999, 2000, 2001, 2002, 2003 is a wholly owned subsidiary of Packetderm, LLC.

Packetderm, LLC
210 Park Ave #308
Worcester, MA 01609