Hello,
I'm using bitbucket pipelines and I need to use the value of a variable but inside of ''.
For example, I want the following: 'environment=dev' and dev is the environmentValue variable.
If I write 'environment=$environmentValue' the result is 'environment=$environmentValue' and not 'environmnet=dev'.
However, if I write echo $environmentValue the result is dev, so I think the error is '' but I need write it with the ''.
Thank you!!
Hi Carmen and welcome to the community!
Everything you put inside single quotes gets interpreted literally, so variables are not substituted. This is a feature of the shell and not specific to Pipelines, please see here for reference:
Variables are substituted inside double quotes. If you use
echo "'environment=$environmentValue'"
you are going to get
'environmnet=dev'
Is this something that works for you?
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are very welcome! Please feel free to reach out if you ever need anything else! :)
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.