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

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events