SHELL

From STX Wiki
Jump to navigationJump to search
SHELL macroname macroarguments

The SHELL command starts a new STx shell (i.e., a new STx command interpreter) to execute the subroutine macroname. Hence, your subroutine will start its existence in a clean execution environment, without any local variables set. It will, differently put, be unable to access the local and the shell variables of the caller. Much less will it be able to alter them (for a different behaviour, see below, or directly refer to the STx statements MACRO, and MACROX).

The macro source code macroname must be loaded (see the LOAD command). The macroarguments passed to the macro are stored in the variable #ARGV of the called macro. Because of the special command-line processing in STx, all string replacements are applied to, and all special parsing information (e.g. quotation marks) are removed from, macroarguments before it is assigned to #ARGV. For more information on argument passing, and parsing, see Argument Passing. For a broader information on macro programming, see Script Programming in STx.

If you want your subroutine to be able to access the environment of the caller, there is the MACRO command for executing the subroutine in a copy of the calling environment, and even the MACROX command for dangerously executing the subroutine directly within the caller's environment.

Navigation menu

Personal tools