That should re-direct the standart output from the opperation to the file. It will not re-direct the standard error output, i'm not sure that a gcc warning wouldn't be directed to std err, so you had better give it a try and see.
gcc &> file to redirec both stderr and stdout, warnings and erors are printed to stderr by gcc. If you want to redirect only stderr then use gcc 2> file. Use the tee program to both print and log data.
E.g. the following command will swap stdout and stderr, print out all messages on screen and also log all warning and errors to "file".
jdarren Why dont you try
jdarren
Why dont you try:
gcc foo.c >> bar.txt
That should re-direct the standart output from the opperation to the file. It will not re-direct the standard error output, i'm not sure that a gcc warning wouldn't be directed to std err, so you had better give it a try and see.
DJ.
Useful guide: http://www.tldp
Useful guide: http://www.tldp.org/LDP/abs/html/ with all kind of goodies. You're asking about I/O redirection.
gcc &> file to redirec both stderr and stdout, warnings and erors are printed to stderr by gcc. If you want to redirect only stderr then use gcc 2> file. Use the tee program to both print and log data.
E.g. the following command will swap stdout and stderr, print out all messages on screen and also log all warning and errors to "file".
gcc 1>&2 2>&1 | tee file
This is all fine and well but
This is all fine and well but when you place the command in a make file such as
$(OBJDIR)\SomeObjFile.o : $(SRCDIR)\$(@B).c $(INCLUDES)
$(CC) $(CFLAGS) -c -o$(OBJDIR)\$(@B).o \
$(@B).cpp 1>&2 2>&1 | tee $(@B).err
the 1>&2 2>&1 | tee $(@B).err are completely ignored.
Anybody know why?