OS

From ICE Enterprises
Jump to navigation Jump to search

sends an operating system command to the appropriate OS

<> - The command (in quotes) to be sent

This command send an operating system command to the operating system that is
running the OS command.  These commands are run internal to the Java Virtual
Machine (JVM).

Note: Because this command line is run through the parser, the command may need
to be quoted depending on the characters in the command.

Other ways to execute OS commands:
=================================
$ - Forces command to be executed in the shell that is running NeXtMidas
    (instead of a subshell). This is run from Java and does not affect your
    UNIX or other shell.

$$ - Forces command to operating system. This will affect your UNIX or other
     shell.  This is equivalent to running the command directly.


Examples:
  1. Perform an OS command without affecting the OS shell

      nM> plot/bg world
      nM> os ls
      nM> $ls

    These are equivalent OS commands run from within Java.  The plot
    will stay up when these return.

  2. Perform an OS command affecting the OS shell

      nM> plot/bg world
      nM> $$cd ~

    The plot goes away and the directory is changed from the current directory
    to the user's home directory.

  3. On UNIX platforms:

      nM> os touch myfile

    creates a file in the current directory

  4. Capture output of OS command to results.
       nM> os/stdout=myres echo hello there

Switches:
  /STDERR=<res>  Capture standard error of OS command into results in a String.
                 This will prevent output to terminal. This switch MUST be right
                 after the command.                                (Since 3.0.0)
  /STDOUT=<res>  Capture standard output of OS command into results in a String.
                 This will prevent output to terminal. This switch MUST be right
                 after the command.                                (Since 3.0.0)
  /EXITSTATUS=<res>  Capture exit status/value of the OS command into results
                 label. By convention, 0 indicates success. This switch MUST be
                 right after the command.                          (Since 3.5.0)