coshell - shell coprocess support
The coshell routines support the shell as a coprocess. This coprocess may be either ksh(1) or sh(1) executing on the local host, or it may be coshell(1) with access to shells on hosts throughout the local network.
The coshell inherits the environment of the calling process. Signals sent to the calling process are passed to the coshell.
More than one coshell may be open in the current process. If the
argument to the
calls below is
then the call is applied to all open coshell.
Returns a pointer to a new coshell.
is returned on error. If
then the coshell executable is determined by doing the usual path search, in order, on the value of the environment variableCOSHELL and the commands ksh and sh.
is the inclusive-or of the following:
|Return a pointer to a previously opened coshell if possible, otherwise open a new coshell.|
|Enable library debug tracing.|
|Ignore any command errors. By default any command error that is not tested by a condtional causes the job to terminate.|
|Commands are to be executed on the local host only.|
|The caller is sh(1): internal file descriptors are moved to 10 or above; SIGSTOP and SIGCONT handlers are not installed.|
|Don’t trace commands. By default commands are traced using the shell -x option.|
|The default flags.|
|The number of jobs that have not been waited for.|
|The number of jobs still running.|
|The total number of jobs sent to the coshell.|
|The total user time of all completed jobs in
|The total system time of all completed jobs in
|Close an open coshell pointed to by
|Sends the shell command line
|A number that uniquely identifies the job within the coshell.|
|The job exit status, valid only for job pointers returned by|
|The flags enabled for this job.|
|A user reserved pointer, initially set to
|The user time of this job in
|The system time of this job in
|Returns the job pointer in the coshell pointed to by
|Returns the number of outstanding jobs that are children of the caller. (Remote jobs or jobs executed by a separate daemon are not counted here.)|
|Returns the number of pending jobs; this is the number of
|Returns the number of jobs that have completed but have not been
|Sync all outstanding file operations for either the file
|Returns the shell initialization commands for the next job. These commands represent process state changes that may have occurred since the last call to
|Applies shell single quoting to
is a hack workaround, but we do have to work in the real world.
A bug in bsh(1) and ksh(1) implementations up to and including ksh88e causes some interrupted jobs to return 0 exit status. This should be fixed in later shell releases.
is reserved by
at the outermost scope. To use
to force a subshell.