blank.gif (43 bytes)

Church Of The
Swimming Elephant

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

interact [flags] - summary of options

complete description

Flags Description
-echo Sends characters that match the following pattern back to the process that generated them as each character is read.  This may be useful when the user needs to see feedback from partially typed patterns.
-ex May be used to protect patterns that might otherwise match interact flags from doing so.  Any pattern beginning with a “-“ should be protected this way.  (All strings starting with “-“ are reserved for future options.)
-i spawn_id Introduces a replacement for the current spawn_id when no other -input or -output flags are used.
-input Input for a group of output spawn ids may be determined by a spawn id list prefaced by a -input flag. 
-iwrite Prefacing a pattern with the flag -iwrite causes the variable interact_out(spawn_id) to be set to the spawn_id which matched the pattern (or eof).
-nobuffer Sends characters that match the following pattern on to the output process as characters are read.  This is useful when you wish to let a program echo back the pattern.  For example, the following might be used to monitor where a person is dialing (a Hayes-style modem).  Each time “atd” is seen the script logs the rest of the line.
-o Causes any following key-body pairs to be applied to the output of the current process.  This can be useful, for example, when dealing with hosts that send unwanted characters during a telnet session.
-output To send output to multiple processes, list each spawn id list prefaced by a -output flag
-re Forces the string to be interpreted as a regexp-style pattern.  In this case, matching sub-strings are stored in the variable interact_out similarly to the way expect stores its output in the variable expect_out.  The -indices flag is similarly supported.
-reset Resets the terminal to the mode it had before interact was executed (invariably, cooked mode).  Note that characters entered when the mode is being switched may be lost (an unfortunate feature of the terminal driver on some systems).  The only reason to use -reset is if your action depends on running in cooked mode.
-u Makes interact look for the user as the process named by its argument (which must be a spawned id).

Gives control of the current process to the user, so that keystrokes are sent to the current process, and the stdout and stderr of the current process are returned. 

complete description

This material is excerpted from the O'Reilly book "Exploring Expect" by Don Libes, and can also be found in the manpage on many UNIX platforms. 



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