Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to Send an Environmental Value Back from a Script File

Sometimes, in order to do a complicated bit of processing, it's necessary to do it in a script file. So, if I have a step which calls some script file, and the script file computes the value of something, how do I pass that value back to Build Forge so that it can be used in subsequent steps? In the script file I've tried doing it with a "SET" command for a "real" environment variable, but Build Forge is having trouble picking it up. I'm guessing this is because the environment has already been set at the beginning of the project whereas I need this variable to be reloaded after the script executes.

Thanks,
John Bobinyec

0 votes



One answer

Permanent link
The only way I have been able to figure out how to do this is to have the script write the value to a file. Then, in the next step in Build Forge, set a Build Forge environment variable to the contents of that file.
example:
Say you script ends up with the value in a UNIX variable: myValue. echo myValue to a file:

echo ${myValue} > tmpFile

Then in the next Build Forge step, set a environment variable, newValue to the contents of the file:

.bset env "newValue=`cat tmpFile`"

Kind of awkward, but it works.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Sep 06 '11, 3:06 p.m.

Question was seen: 6,652 times

Last updated: Sep 06 '11, 3:06 p.m.

Confirmation Cancel Confirm