Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Cannot redirect script output

Jason Erickson January 23, 2013

I am using Bamboo to run a script that compiles our source code. We use a custom developed compiler that is called from this script. The compiler displays a compile log as output, which the script redirects to a text file using the method below:

call compiler >compilelog.txt

The output works fine when run from the command line, however when I execute the script in Bamboo, the log output never gets redirected. If I look at the log created by Bamboo, a '1' is entered before the output is redirected as shown below:

call compiler 1>compilelog.txt

I guess my question is why is the '1' being placed in my script, which seems to be ignoring the output destination. It is very important that this log is saved in the text file that we are attempting to output it too, as we use this log for many reasons. Any help on how to surpass this issue would be greatly appreciated.

Thanks!

Jason

1 answer

1 accepted

0 votes
Answer accepted
Matt
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 23, 2013

Bamboo puts 1 to your output to store stdout to your file.

This allows to catch stderr and prints it in the bamboo logs.

Make sure that your compiler prints to stdout instead stderr

You may also try:

call compiler 1>compilelog.txt 2>&1

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events