I need to run a script using /bin/bash instead of /bin/sh, but I'm not seeing a way to do that.
In the logs, I see that /bin/sh is used to execute my script. In my script, I print out the $SHELL variable, and nothing shows up on the screen. So, I assume it's /bin/sh that's being used to run the script... but I can't confirm it. Putting #!/bin/bash at the top of my script doesn't help.
The reason I need to use /bin/bash is that a process I need to start requires a set of environment variables to be set using a an inline function (e.g., source `rosstack find orocos_toolchain`/env.sh) but I don't believe /bin/sh supports that, or the source call.
I currently have this problem and not sure where to find this builders admin menu. Our system actually runs on bin\ksh but bin\bash will do for this instance as we just need a script to run
Could you possibly send a screenshot.
I am using Bamboo:
Bamboo version information
Build date 4/28/16
The accepted answer works if you are running a "command" task from bamboo (i.e. execute a script file).
If you are trying to run a "script" task, which is just running an inline script, you can try putting this snippet at the top to force it to execute in bash. It's a hack, but it worked for me:
#!/bin/bash if [ "$(ps -p "$$" -o comm=)" != "bash" ]; then # Taken from http://unix-linux.questionfor.info/q_unix-linux-programming_85038.html bash "$0" "$@" exit "$?" fi
In Bamboo < 5.13, on the agents, if the non-login shell is bash, it should work adding the she-bang on script tasks.
You can achieve that by linking /bin/sh to /bin/bash, instead of /bin/dash or whatever.
From 5.13, it should work regardless of your non-login shell.
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...
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!
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
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot