Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: Initializing the Interpreter Up: Internals Previous: Suppressing Stand-Alone Client Behavior

The ``Shell" Client

Glish creates and manages asynchronous shell clients (i.e., created using the shell function's async=T option; see § 10.9, page [*]) using a special client called shell_client. shell_client is invoked with an optional -ping argument (to implement ping=T) and then a list of arguments corresponding to the shell command.

Prior to executing the shell command, shell_client attempts to create a ``pseudo tty" master/slave pair. If successful then it uses the pseudo-tty for the shell command's stdin and stdout; this causes the command to believe it is communicating directly with a user, so it will generate prompts, perhaps use terminal escape sequences where appropriate, and, most importantly, line-buffer its output.

If shell_client fails to create a pseudo-tty then it uses a pair of pipes to communicate with the command. In this case, the commands' output will be block-buffered, meaning that it may not appear at all until the command has either generated a lot of output, or terminates. This behavior makes the shell command much more difficult to use as a Glish client, because its output appears unpredictably.

Each line of output generated by the shell command results in a string-valued stdout event (as discussed in § 7.8.2, page [*]. shell_client itself responds to the following events:

stdin
instructs shell_client to make a string representation of the stdin event's value appear on the command's stdin input stream.

EOF
causes shell_client to close the command's stdin.

terminate
results in shell_client killing the shell command by sending it a SIGTERM signal.


next up previous contents index
Next: Initializing the Interpreter Up: Internals Previous: Suppressing Stand-Alone Client Behavior   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15