Executing Shell Commands
========================
The subprocess handling of `librep' provides a comprehensive
interface to starting and controlling external processes (Note:Processes). However it can be overkill when all that is required is
to invoke a shell command, with its I/O going to the same places as the
interpreter's.
- Function: system command
Execute the shell command COMMAND synchronously, returning its
exit status. An error will be signalled if the shell process could
not be started.
The `stdin', `stdout' and `stderr' streams of the shell are left
as in the interpreter process.
The subprocesses environment is copied from the current value of
the `process-environment' variable.
Note that the exit status is _not_ the same as the return code of
the command. It depends on the operating system, but under UNIX the
return code can be found through right-shifting the exit status by
eight bits. Low non-zero values represent that the process was killed
by a signal.
It is possible to interrupt a running shell process in the same way
as with a normal synchronous process (Note:Synchronous Processes).
Interrupt the interpreter, it will send progressively harder-to-ignore
signals to the child each interrupt, until it is eventually terminated.