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.
You should be able to add a new builder from the builders admin menu {URL}/admin/agent/viewBuilders.action
e.g. on our Bamboo instance our Bash builder uses /bin/bash
Good Day
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
Version5.11.1.1
Build number51117
Build date 4/28/16
Please help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In Bamboo 6.1 you can add a script command and have it run in sh or bash or ps.
Not sure if this helps since you're on 5.11
The solution above was for Bamboo Cloud.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Very nice! Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Woohoo! Thanks. You would expect this to be simpler with bamboo....Atlassian, are you listening?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This really sucks when you have to bootstrap it in 30 different script tasks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Doesn't work, my Bamboo version is 6.9.2.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if you use git/sh use
#!C:\PROGRA~1\Git\bin\sh.exe
in your shebang line (first line in inline script)
It's an absolute path. You can run any interpreter this way (cygwin/mingw). Please note: no spaces in the file name!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
https://confluence.atlassian.com/bamboo/bamboo-5-13-release-notes-829057609.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How can I achieve this without upgrading.
Currently running:
Bamboo version information
Version5.11.1.1
Build number51117
Build date4/28/16
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.