Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Array value on Environment Variables for BitBucket Pipelines

daviedR August 26, 2018

Hi,

Is it possible to set array value on Repository settings > Pipelines > Environment variables?

 

I tried:

(foo bar)

But doesn't work. 

1 answer

1 accepted

1 vote
Answer accepted
mwatson
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 28, 2018

Environment variables can have any value, it depends upon how you use them in your scripts. in simple shell scripts you can set a variable to a sequence separated by spaces (the default, lookup the IFS shell variable: https://en.wikipedia.org/wiki/Internal_field_separator)  and then process them as a list, e.g.

 

F="a b c"
for i in ${F}
do
echo $i
done 

When you set the variables value in pipelines, there is no need for the '"'s - only when you set it in the shell. 

daviedR August 31, 2018

Thanks Matthew!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events