To use the value stored in a variable, use the dollar sign followed by the variable name enclosed by parentheses or curly braces.
x = hello
y = $(x)
# y now contains the value "hello"
y = ${x}
# parentheses and curly braces are treated exactly the same
If a variable's name is only one character long, the parentheses/braces can be omitted (e.g., $x
). This practice is used for automatic variables (see below), but is not recommended for general-purpose variables.