In Atlassian Bamboo, in script tasks you can use special Bamboo environment variables e.g. for current build number
${bamboo.buildNumber}
Now I have the impression if I have a code piece like ${VAR}
which I want to pass to other context, Bamboo's templating logic will kick in and render this part as an empty string.
Proof:
echo "my foo ${VAR}!"
Output:
01-Feb-2018 20:47:58 my foo !
Is there a way to escape curly braces in this context?
What I have tried:
- googling it: nope
${{VAR}}
- bad substution error$\{VAR\}
leads to exactly same output as it escaped which I do not want to have either.
UPDATE from comments - making sure there is no existing variable being just empty.
Input:
echo "my foo random ${RANDOM_VAR_ABCFOO}!"
echo "my foo random with prefix ${bamboo.RANDOM_VAR_ABCFOO}!"
Output:
Bamboo 5.13.1
02-Feb-2018 10:26:11 my foo random !
02-Feb-2018 10:26:11 /home/bambooagent/temp/FOO-JOB1-4-ScriptBuildTask-3130782940072218698.sh: 2: /home/bambooagent/temp/FOO-JOB1-4-ScriptBuildTask-3130782940072218698.sh: Bad substitution
Bamboo 6.3.0
02-Feb-2018 10:22:02 my foo random !
02-Feb-2018 10:22:02 /data/bamboo-agent/temp/FOO-JOB1-24-ScriptBuildTask-7913400670965638044.sh: line 2: my foo random with prefix ${bamboo.RANDOM_VAR_ABCFOO}!: bad substitution
echo "\${VAR}"
?