Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Password variable contains backticks, substitution fails in deployment plans


Say my MySQL password looks like this


which contains a backtick. Of course, it might contain a " or ' or $ or other expandable sequence.

When variable substitution occurs in a deployment plan


 I get this error

error 20-Nov-2019 13:47:21 bash: -c: line 11: unexpected EOF while looking for matching ``' error
20-Nov-2019 13:47:21 bash: -c: line 37: syntax error: unexpected end of file

How can I ensure that variables are safely substituted in deployment (and, presumably, build) plans and ensure they are not interpreted?

Of course, I could create only alphanumeric passphrases, but that reduces entropy somewhat and I don't want to limit our infrastructure configuration. Do I need to use Bamboo Specs or something?

We're running self-hosted Bamboo version 6.3.4 build 60309 - 24 May 18

1 answer

Hi @Michael

Thank you for raising this question.

Global, plan and deployment variables can be evaluated in tasks by using the following format: 


Please notice that this evaluation takes place before the task is executed.

Let's suppose you are adding the following line in your inline script:


Before bash is called the variable is already substituted and you have the error mentioned.

...bash: -c: line 11: unexpected EOF while looking for matching...

How to avoid this?

Use a different variable formating.

We have two ways to mention a variable:

  1. ${bamboo.<variableName>}
    Evaluated before the build
  2. $bamboo_<variableName>
    Available  only when the bash script is run


How to move forward?

Please use the second format in inline scripts. It will prevent anomalies caused by strange characters that may be part of your variables.

Another option is to make sure the content of your variables is surrounded by single quotes ( 'content' ).


I hope that helps 

It does; thank you!

One clarification: how should I use Bamboo variables that have dots in their names, like `bamboo.deploy.environment` ?





Presumably I should convert all `.` to `_` ?

Yes, convert all of them to underscores "_".
You should be able to see all the variables available in your build log file.
Try to search for one that you know and you should find all of them together.


Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bamboo

Bamboo Data Center on Kubernetes

Hi, If you are running self-managed environments and looking to adopt modern infrastructure, Bamboo Data Center can now be deployed in a Kubernetes cluster. By leveraging Kubernetes, you can easily...

46 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you