Cannot redirect script output

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

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published 4 hours ago in Hipchat

Moving from Hipchat to Stride? Here’s what you’ll love

Heya, Hipchat friends! We’re so happy you’re checking out   Stride. Whether you know it or not, you have been instrumental in making Stride come to life. Every feature, design, and functionality...

21 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you