how to run bash script with args (builder created)

In one task, I need to execute a BASH script like so:

workingDir> ./ -p staging


  1. created an "Executable" pointing to /bin/bash
  2. created a 'command' task, using above executable
  3. specified "./ -p staging" as Argument
  4. set working dir to $workingDir

yet running the build I get:

... running command line:
/bin/bash -p staging
... in: /opt/clabs/bamboo-home/xml-data/build-dir/ECR-CLP774-JOB1/deploy
... using extra environment variables:
21-Feb-2012 20:13:10 /bin/bash: -p staging: No such file or directory

trimming Argument field to just "./" works, but I do need to pass that option. What am I missing?

I am using 3.4.3 build 2811


3 answers

1 accepted

I just tried the same thing here and it worked. Could you screenshot your Command Task configuration and repost it here for me to take a look?

0 vote
Colin Goudie Community Champion Mar 18, 2012

Just to answer this, I think Bamboo's description field for arguments is confusing.

If you are passing args to bash etc.. and they are separate arguments then you DONT need to enclose them in quotes in the textfield. At least that is what I have found

I could never get this work. I am running Bamboo

Using the example above:

. -p staging

staging was ignored. If I created an environment variable (e.g. STAGE_NAME=staging) and referenced $STAGE_NAME in the script it worked fine. But I could never get staging to be passed in. I tried passing it using the arguments field - both with and without quotes - but still no joy.

In the end I wrapped the commands I was calling in a python script and it worked as expected. i.e.

python -p staging


Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,788 views 0 6
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you