BuildForge Help

Resolving Undeclared Environment Variables

To reference environment variables in step commands and environments, Build Forge supports the substitution variable formats (shown with the echo command) in the following table.

If the referenced variable is undefined, how it is resolved depends on whether pre-parsing is turned on (default) or off. Pre-parsing behavior is set by editing the no_preparse command in the bfagent.conf file or the _NO_PREPARSE_COMMAND environment variable. See Special Case Variables.

If the variable is undefined and pre-parsing is on, Build Forge replaces the variable with its name. The exception to this rule is $[foo] which replaces an undefined variable with an empty string.

Substitution Variable Format Undefined Variable Resolution - Preparsing On (Default) Undefined Variable Resolution - Preparsing Off
echo %foo% foo

Windows: %foo%

UNIX or Linux: blank

echo $foo foo

Windows: $foo

UNIX or Linux: blank

echo ${foo} foo

Windows: ${foo}

UNIX or Linux: blank

echo $[foo] blank

Windows: $[foo]

system error