The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to save a file with multi lines to a variable

Bill Wang
Contributor
March 22, 2018

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Bill Wang
Contributor
March 22, 2018

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

TAGS
AUG Leaders

Atlassian Community Events