Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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

How to save a file with multi lines to a variable


I need save a file to variable for one bamboo server build plan


In build, I need echo the variable and save to a file which I want to get exact format. 


How to do that?


    echo "${bamboo_key}" > /key

1 answer

1 accepted

1 vote
Answer accepted

I fixed it by myself.


cat file |base64   # in some OS, the output are multiple lines as well, just remove "\n"


then copy the string into the variable in bamboo plan


When run the build, add below line


echo ${bamboo_key}|base64 -d > /key

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bamboo

Bamboo Data Center on Kubernetes

Hi, If you are running self-managed environments and looking to adopt modern infrastructure, Bamboo Data Center can now be deployed in a Kubernetes cluster. By leveraging Kubernetes, you can easily...

56 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