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

Exit status in a post command build

How can I get the return code in a post command build?

I have the following post commands in a build definition:

echo "Hello"
echo $?

But $? returns: ? and it should returns 0 because echo "Hello" finished OK. How can I get that status code or what other way exists for getting the status code from echo "Hello"?

0 votes


Accepted answer

Permanent link
Have you tested the script separately? Are you running the script on Linux or Windows? The below commands work for me in a standalone script.
Linux:
echo "Hello"
echo $
Windows:
ECHO "Hello"
ECHO %ERRORLEVEL%
Fran Burgos selected this answer as the correct answer

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
× 6,132

Question asked: Aug 13 '15, 4:05 a.m.

Question was seen: 2,544 times

Last updated: Aug 14 '15, 1:58 a.m.

Confirmation Cancel Confirm