1 # $NetBSD: varname-dollar.mk,v 1.3 2020/08/19 05:40:06 rillig Exp $
3 # Tests for the expression "$$", which looks as if it referred to a variable,
4 # but simply expands to a single '$' sign.
6 # If there really were a special variable named '$', the expressions ${${DOLLAR}}
7 # and $$ would always expand to the same value.
9 # Using the dollar sign in variable names is tricky and not recommended.
10 # To see that using this variable indeed affects the variable '$', run the
11 # test individually with the -dv option.
14 # At this point, the variable '$' is not defined. Therefore the second line
15 # returns an empty string.
17 .info dollar in braces is ${${DOLLAR}}.
19 # Now overwrite the '$' variable to see whether '$$' really expands to that
20 # variable, or whether '$$' is handled by the parser.
23 # At this point, the variable '$' is defined, therefore its value is printed
24 # in the second .info directive.
26 .info dollar in braces is ${${DOLLAR}}.