POPEN(command [,[mode] [,stream]]) A Bourne Shell is started off in the background to run the given command with a one-way pipe leading from or to it. If the mode is omitted, or starts with the letter R, then the output of the command may be read from the pipe. If a mode starting with the letter W is given, then the input of the command may be written down the pipe. NOTE: Care must be taken when opening pipes for writing, because if the command fails or terminates unexpectedly then the Rexx program will receive a SIGPIPE and terminate. To counter this see OPTIONS 'SIGPIPE' and always check for the NOTREADY condition when writing down the pipe. The return value from popen will be zero if the pipe was opened successfully, or an error number if not. Note that the pipe may still be opened successfully even if the command can not be executed: it is the Bourne Shell's job to report that the command can not be executed. The return code from the shell can be obtained with the pclose function. This function will not raise the NOTREADY condition, nor will it record any error for STREAM(). If the stream argument is supplied, then any future reference to the pipe will use this as the stream name - otherwise the command in full will be used. If a stream argument is supplied which already refers to an open stream, then that will be closed after the pipe has been successfully opened. This means that the pipe will be opened on a different descriptor, and the popen function should not be used to redirect the standard input, output or error. The pipe should be closed with the pclose function so that the shell process may be removed from the process table. If that is not done, then defunct processes will remain until REXX exits. This may be acceptable for a small number of popen calls, but not if the REXX program calls popen many times or is long-lived. Example: the following program outputs in hex, using an "od" process: output= "/bin/od -x" call popen output,"w" call lineout output,"This is some sample output" call pclose output This call is equivalent to STREAM(stream,'c','popen' [mode][,command]) and may be deleted in future releases.