[arch-general] How to do this
Baho Utot
baho-utot at columbus.rr.com
Sun Oct 24 11:34:14 EDT 2010
On 10/24/10 11:20, Johannes Held wrote:
> Christian<christian08 at 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.
More information about the arch-general
mailing list