Table of Contents
The Tcl interpreter does only one substitution pass during command evaluation. Some situations, such as placing the name of a variable in a variable, require two passes through the substitution phase. In this case, the subst command is useful.
Subst performs a substitution pass without performing any execution of commands except those required for the substitution to occur, ie: commands within [] will be executed, and the results placed in the return string.
In the example code:
puts "[subst $$c]\n"
The format command can also be used to force some levels of substitution to occur.
Passes string
If any of the -no... arguments are present, then that set of substitutions will not be done.
NOTE: subst does not honor braces or quotes.