Escaping curly braces in Bamboo
I don't know the inner of bamboo, but I assume it works like a bash script.

What happens is that variables are replaced before execution, in bash that would be echo "echo $VAR" &gt; test.sh and test.sh will only contain "echo" because VAR is replaced by it's value before the command is executed.
If you want test.sh to contain echo $VAR you have to tell bash to ignore the replacement on the first call by escaping the $ sign:

echo "echo \$var" &gt; test.sh will give echo  $VAR in the file.

In the same note, the notation ${VAR} and $VAR are the same, using braces is a good practice when you do concatenation like in echo "Size is ${VAR}Kb" as without the braces like this $VARKb bash would try to find a variable named VARKb and return an empty value.

To address PrestonM different behavior, I assume there's either
 - the fact running under windows with the powershell interpreter doesn't behave the same
 - or just that bamboo has a special case for variables prefixed with bamboo. and as such escape them.

If someone want to test you may try:

echo "${VAR}"
echo "${bamboo.VAR}"
echo "\${VAR}"


and edit the results in this answer.