GNU Rush |
|
Restricted User Shell |
Sergey Poznyakoff |
Rules can change or unset variables. Two separate groups of
statements are provided to that effect. The set
, unset
,
and map
statements operate on positional, request, and
user-defined variables. The setenv
, unsetenv
,
clrenv
, and keepenv
statements modify the environment.
These will be discussed in a separate subsection (see Environment).
Modifications to positional and request variables deserve a special explanation.
The only two request variables that can be modified (but not unset)
are $command
and $program
.
Positional variables and the $command
request variable are
mutually dependent. If the $command
is modified, the word
splitting is applied to it and resulting words are assigned to the
positional variables. Similarly, any modifications to positional
variables trigger rebuilding of the $command
variable from the
modified arguments. Both operations are run immediately after the
change that triggered them. Notice, however, that any transformations,
including variable modifications, are executed after match
statements have been evaluated, so that match
always operates
on unchanged variables, no matter where in the rule you place it,
If the rules result in accepting the request, then modified
$command
becomes the actual command that rush
will
execute.
Obviously, none of the request variables can be unset. You can however, unset a positional variable (excepting ‘$0’). It is equivalent to removing the corresponding argument from the command line.
This document was generated on January 2, 2022 using makeinfo.
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.