NM

From ICE Enterprises
Jump to navigation Jump to search

oneshot NeXtMidas command interface for OS, NeXtMidas and X-Midas shells

<command string> - The command to run [DEF=""]

This explain file covers running from:
  * OS
  * NeXtMidas Shell
  * X-Midas Shell

This will run a NeXtMidas command. How the command is run depends on where NM
is run from.

RUN FROM OS SHELL:
  With no arguments, nm gets the user into the shell. With arguments, it enters
  the shell, executes the command, and exits the shell (this is called one-shot
  mode).

  As of NeXtMidas 2.0.0 there are 3 commands that are treated specially by the
  "nm" script:
     nm MAKE <func> <opt>       - Builds the boot classes before running the
                                  normal MAKE command.
     nm EDIT <cmd> <area> <opt> - This runs the nmedit script.
     nm END                     - This runs the nmend script.

  When run from the OS Shell the NM command has special options used to set Java
  environment variables. Run "nm -HELP" to see a complete list of options.

  It is important to note that quotes ("...") may be stripped off by some OS
  shells before they get into the NeXtMidas session. One way to work around
  this (in Unix) is to add extra single-tic quotes ('...') around the entire
  command line. For example, rather than using this:

    $ nm mycommand "jdbc:oracle:thin@host:port:stuff" "user" "pass"

  Use this:

    $ nm 'mycommand "jdbc:oracle:thin@host:port:stuff" "user" "pass"'
         ^                                                          ^

RUN FROM NEXTMIDAS SHELL:
  This is not supported, at this time.


RUN FROM X-MIDAS SHELL:
  The NM command manages all interaction with the shared Java VM that is used to
  run NeXtMidas commands. The NM command has the following functions:
    NM/ON/BG/ID=999    - Starts the shared Java VM and initializes NeXtMidas
                         classes. NOTE: The /ID switch is optional but necessary
                         to allow subsequent NM commands to send and receive
                         messages.
    NM <cmd>           - Runs a command in NeXtMidas (similar to one-shot mode).
    NM/OFF             - Stops the shared Java VM.

  When running from X-Midas, X-Midas will pre-translate ALL carets before the
  command line is passed to NeXtMidas, for example:
    X-Midas> res x 2
    X-Midas> nm res x 3
    X-Midas> nm calc y ^x 1 +      <-- X-Midas translates "^X" to "2"
    Calc: Y = 3.0

  To "preserve" the carets so they are evaluated by NeXtMidas it is necessary
  to use a double-caret (X-Midas' escape for a caret), for example:
    X-Midas> res x 2
    X-Midas> nm res x 3
    X-Midas> nm calc y ^^x 1 +     <-- X-Midas translates "^^X" to "^X"
    Calc: Y = 4.0

  For more details, please see the appropriate section in the "NeXtMidas User's
  Guide."

Switches:
  X-Midas ONLY:
    /BG           - Runs the command in the background with respect
                    to the X-Midas shell.
    /CLEAN        - Clean up the JVM and message queues (IPC).
    /CLEANUPATEXIT- Experimental switch to add additional exit hook to try to
                    cleanup message queue on exit of the JVM and only should be
                    used with the /ON switch (since NeXtMidas 2.9.0).
                    Experimental switches can be removed in a future release.
    /CP=str       - NOTE: This switch is of little at present since X-Midas
                    uppercases this switch.
                    Adds elements on the front of the classpath.
    /DEBUG        - Turns on general debugging messages.
    /ID=<n>       - With /ON only. Enables messaging for subsequent commands.
    /JARS=str     - Adds JAR files to the end of the classpath.
    /JDEBUG       - Turns on debugging messages in the JNI code.
    /JVMOPTIONS=s - Sets special Java VM flags.
                    -DNOIMPORTXMPATH=TRUE to disable auto importing of X-Midas
                    path into NeXtMidas (since NeXtMidas 2.9.0).
    /KILL         - Alias for /OFF, turns the shared JVM off.
    /MSGOPT=<opt> - Override which option tree defines the configured messages.
                    Use NXM for the NeXtMidas SYS option tree, use of SYS
                    (X-Midas SYS option tree is not supported). This must be
                    set when NM/ON is done. [DEF=NXM]
    /OFF          - Turns the shared JVM off.
    /ON           - Turns the shared JVM on (must be used with /BG).
    /PN=str       - Sets the process name.
    /STATUS       - Reports the status of the shared JVM.
    /VERBOSEGC    - Sets the "-verbose:gc"  flag for the Java VM.
    /VERBOSEJNI   - Sets the "-verbose:jni" flag for the Java VM.
    /VERIFYALL    - Sets the "-Xverify:all" flag for the Java VM.
    /XCHECKJNI    - Sets the "-Xcheck:jni"  flag for the Java VM.
    /XS=n         - Allows a graphical NeXtMidas primitive to LEARN
                    window positions (see XPIPE).

See Also: MAKE, EDIT, GENMSGTBL