Despite the documentation of the different forms of variable definition above, it can be hard to work out what happens when variable operators are combined. This section documents some common questions people have regarding the way variables interact.
There is often confusion about which order overrides and the various append operators take effect.
OVERRIDES
= "foo"A_foo_append
= "X"
In this case, X is unconditionally appended to the variable A_foo
. Since foo is an override, A_foo would then replace A
.
OVERRIDES
= "foo"A
= "X"A_append_foo
= "Y"
In this case, only when foo is in OVERRIDES, Y is appended to the variable A
so the value of A
would become XY (NB: no spaces are appended).
OVERRIDES
= "foo"A_foo_append
= "X"A_foo_append
+= "Y"
This behaves as per the first case above, but the value of A
would be "X Y" instead of just "X".
A
= "1"A_append
= "2"A_append
= "3"A
+= "4"A
.= "5"
Would ultimately result in A
taking the value "1 4523" since the _append operator executes at the same time as the expansion of other overrides.