Next: , Previous: , Up: Top   [Contents][Index]


6 Meta-variable

Environment meta-variable is a special feature, that replaces the traditional variable reference syntax (see Variable references) with referencing via a single meta-variable - an approach traditionally used in many programming languages. The name of the meta-variable is introduced using the -e command line option:

xenv -e ENV

Once the meta-variable is defined, all constructs discussed above lose their special meaning and are reproduced on the standard output verbatim. Instead, the following constructs are recognized as variable references:

$ENV{name}
$ENV{name:-word}
$ENV{name:=word}
$ENV{name:?word}
$ENV{name:+word}
$ENV{name:|word1|word2}

The constructs for command substitution, verbatim quotations and comments become $ENV(...), $ENV[...], and $ENV{* ... *}, correspondingly.

Any sequence of characters can be used as the meta-variable name, provided that the sequence itself is a valid variable name.