GNU Rush legacy configuration syntax (split by node):   Section:   Chapter:FastBack: Rule   Up: Rule   FastForward: Include   Contents: Table of ContentsIndex: Concept Index

3.4 Environment

The env action modifies the environment in which the program will be executed.

Rule Config: env args

Modify the environment.

Its arguments are a whitespace-delimited list of specifiers. Each specifier can contain references to variables from the inherited environment. The reference syntax is the same as in Bourne shell.

The following specifiers are understood:

- (a dash)

Clear the environment. This is understood only when used as a first word in args.

-name

Unset the environment variable name.

-name=val

Unset the environment variable name only if its value is val.

name

Retain the environment variable name.

name=value

Define environment variable name to have given value.

name+=value

Retain variable name and append value to its value. If no such variable is present in the environment, it is created and value is assigned to it. However, if value starts with a punctuation character, this character is removed from it before the assignment. This is convenient for using this construct with environment variables like PATH, e.g.:

PATH+=:/sbin

In this example, if PATH exists, ‘:/sbin’ will be appended to it. Otherwise, it will be created and ‘/sbin’ will be assigned to it.

This is roughly equivalent to

PATH=$PATH:/sbin
name=+value

Retain variable name and prepend value to its value. If no such variable is present in the environment, it is created and value is assigned to it. However, if value ends with a punctuation character, this character is removed from it before assignment.

GNU Rush legacy configuration syntax (split by node):   Section:   Chapter:FastBack: Rule   Up: Rule   FastForward: Include   Contents: Table of ContentsIndex: Concept Index