(string) SetExpand(string, use_env)
This function returns a copy of string which expands variable
references in the form $(word) in string. The word
is expected to be a variable previously set with the Set
function or !set command. The value of the variable replaces
the reference in the returned string. If the integer use_env
is nonzero, variables found in the environment will also be
substituted. If word is not resolved, no change is made.
Otherwise, in general, the token is replaced with the value of word.
There is an exception to the direct-substitution rule. If any
substitution string is of the form ``(...)'', then the
parentheses and leading/trailing white space are stripped before
substitution, and the entire substituted string is enclosed in
parentheses if it is not already. This is for convenience when adding
a directory to a search path (see 1.2.4) variable, and the
path is enclosed in parentheses. See the !set command
description in 14.19 for more information.