SYSTEM

##
SYSTEM

            [SIC\]SYSTEM ["Command"]
            $ Command

        Execute a command from the operating system, or create a subshell.

        Interactive shell (no argument)

          If  no  argument  is  given, start a subshell based on the SIC logical
          GAG_PROCESS. If it is not defined, the user $SHELL  environment  vari-
          able is used. If it is also not defined, the last fallback is /bin/sh.
          The subshell can be terminated by typing `exit' or `bye' or  `logout',
          depending on the shell, and controls return to SIC in this case.

        Script/command execution (one string argument)

          If  an  argument  is  given, execute the command in a /bin/sh subshell
          (note that /bin/sh is system-dependent and  might  behave  differently
          from one system to another). It must be a single argument: use double-
          quotes to enclose multiple arguments separated by blanks. Note that an
          error  is  raised if the shell command returns a non-zero status. This
          behavior can be modified in 2 manners:
          - use dedicated command options, if any, to ensure it does not  return
            a non-zero status (for example -q option for grep),
          -  catch  the  error in the shell way, e.g. terminate the command line
            with " || true" which executes the "true" command if  an  error  oc-
            curs. Obviously ignoring errors is at your own risk.

          Processes started in background from SYSTEM (for example with "&") be-
          long to SIC process group and are terminated when SIC exits.  To  keep
          such  a  process running after SIC termination, start it with `setsid'
          (for example `SYSTEM "setsid ./job.sh &"'). This creates  a  new  ses-
          sion/process  group detached from SIC. Such detached processes are not
          managed by SIC anymore and must be terminated by other means.

          Note that Unix environment variables cannot be defined in such a  way,
          since  it  is  a subshell (i.e. the environment modifications are lost
          when the subshell ends). In particular, use command  SIC DIRECTORY  to
          change your working directory.

        $ Command (direct command execution)

          At  the  interactive  prompt, system commands can also be executed di-
          rectly from the SIC level using the $ token. "Command" must be a valid
          operating  system  command  in the default shell of the user (e.g. $ls
          -l). The $ token is invalid in procedures.