On 10/24/10 11:20, Johannes Held wrote:
Christian<christia...@runbox.com>:
I know that I have to use piping for this, but I want to output the
errors I get while compiling a program into atext file.
What to type after make then?
You could try "tee". man tee.

your_command | tee file_1 file_2



If you need to bail from a calling makefile/bash script if an error occurs do this:

LOG=<your_log_file>

( <your_command> | tee -a ${LOG} && exit $PIPESTATUS ) # append to a log file

( <your_command> | tee ${LOG} && exit $PIPESTATUS ) # overwrite the log file

Then the calling makefile/bash script will bail on an error and not continue.

Reply via email to