This question is in reference to Atlassian Documentation: Bamboo variables
Does anyone know how to escape a variable on a custom command? For example, I want to use ${PWD##*/}, which will get me the working directory without the path. This works on the command line but not when parsed through the bamboo interpreter since it matches the format bamboo uses for variables.
Hello Rob,
Thank you for your inquire.
Could you provide us with an example to the "custom command" so we can evaluate the way ${PWD##*/} is being executed, please?
—
Kind regards,
Rafael P. Sperafico
Atlassian Support
Have /bin/mv added as a custom exe on the server & trying to do something like...
/bin/mv this.tar.gz /opt/atlassian/bamboo/home/xml-data/builds/${PWD##*/}/download-data/build_logs/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Rob,
I have just test it using the following and the build ran successfully, mostly important, the file has been moved to the destination directory:
#!/bin/bash echo ${PWD##*/} /bin/mv "foo.txt" "/opt/atlassian/home/atlassian-bamboo-5.10.0/xml-data/builds/${PWD##*/}/download-data/build_logs/"
If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired.
Thank you for your understanding.
—
Kind regards,
Rafael P. Sperafico
Atlassian Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you confirm that Bamboo uses /bin/bash and NOT /bin/sh?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have confirmed that bamboo uses sh when executing scripts, though if you setup the script as a command it runs it via bash
sh does not allow for array processes. this is an odd limit to impose.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.