<< Previous Contents Index Next >>

3.4. Symbol substitution

Symbols are defined by the '=' sign, e.g.

sets the symbol "hello" to contain the string "hello, world". Note that there must be whitespace either side of the '=' character.

Symbols can be substituted by use of the dollar sign ('$'). If unquoted, the string is parsed as if it is part of the input; whitespace within the expanded string will be parsed as a statement separator. The exception is that if the symbol is empty (or non-existent), the string will be treated as a null string, not a missing parameter.

In a string quoted with double quotes, the symbol is expanded inside the string; thus it will remain part of the parameter which the enclosing quotes represent, regardless of whitespace or quote characters contained in the expanded string.

Symbol substitution is not performed inside strings quoted with single quotes.

For example:

If a symbol being substituted has not been assigned, the environment is also searched; if there is still no match, the symbol is substituted with a null string.

The export keyword can be used to export an assigned keyword to the environment for use by a called subprocess, e.g.

Several symbols are predefined:

Note that symbol definition can not be done inside a block.

3.5. Lexical control: if / else if / else / end if

The configuration file can be parsed conditionally via the if / else if / else / end if constructions.

The if statement is in the form if cond, with cond defined as parameter relop parameter [logop cond ...]. relop can be one of:

Comparisons are done as either strings, or if both strings are wholly numeric, as numbers.

logop can be one of and or or.


<< Previous Contents Index Next >>