GNU Rush – a restricted user shell (split by node):   Section:   Chapter:FastBack: Configuration File   Up: Rule   FastForward: Default Configuration   Contents: Table of ContentsIndex: Concept Index

4.4.4 Environment

The following actions modify the environment in which the program will be executed.

rule: clrenv

Clear the environment.

rule: keepenv list

Retain the names in list in the environment. This statement should be used in conjunction with clrenv.

Argument is a whitespace delimited list of variables to retain. Each element in the list can be either a variable name, or a shell-style globbing pattern, in which case all variables matching that pattern will be retained, or a variable name followed by an equals sign and a value, in which case it will be retained only if its actual value equals the supplied one. For example, to retain only variables with names beginning with ‘LC_’:

keepenv "LC_*"
rule: setenv name = value

Set the environment variable name. The value argument is subject to variable expansion (see Variable expansion) and backreference interpretation (see backreference).

For example, to modify the PATH value:

setenv PATH = "$PATH:/opt/bin"
rule: unsetenv list

Unset environment variables listed as arguments.

Argument is a whitespace delimited list of variables to retain. Each element in the list can be either a variable name, or a shell-style globbing pattern, in which case all variables matching that pattern will be unset, or a variable name followed by an equals sign and a value, in which case it will be unset only if its actual value equals the supplied one.

rule: evalenv string

Performs backslash interpretation, backreference interpretation and variable expansion on string and discards the result. This statement is similar to the shell’s colon statement. For example, the following statement will define the DEPTH variable and initialize it to 10, unless it is already defined:

evalenv ${DEPTH:=10}

GNU Rush – a restricted user shell (split by node):   Section:   Chapter:FastBack: Configuration File   Up: Rule   FastForward: Default Configuration   Contents: Table of ContentsIndex: Concept Index