It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Array value on Environment Variables for BitBucket Pipelines

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 Aug 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. 

Thanks Matthew!

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,031 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you