Make Bamboo Shell Task Run Using Bash

Bamboo will call shell tasks on *nix agents using sh as opposed to Bash. For Debian agents, this means dash not bash. So, how do we redirect to bash? I found this snippet:

if [ "$(ps -p "$$" -o comm=)" != "bash" ]; then
# Taken from http://unix-linux.questionfor.info/q_unix-linux-programming_85038.html
echo "RUNNING THIS PUPPY THE RIGHT WAT"
bash "$0" "$@"
exit "$?"
fi

Alas, though, looks like the link I copied and pasted from the post does not work. Here’s the post I snagged this from.

Download PDF
This entry was posted in Bamboo, Bash, Snippets. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *