delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/09/13/03:45:31

From: AndrewJ <luminous-is AT REMOVE DOT home DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: messages
Message-ID: <nfburss8jbur6l6muhfs1lco6rl6vl55up@4ax.com>
References: <8pmgen$s8u$1 AT nnrp1 DOT deja DOT com>
X-Newsreader: Forte Agent 1.7/32.534
MIME-Version: 1.0
Lines: 22
Date: Wed, 13 Sep 2000 07:36:09 GMT
NNTP-Posting-Host: 24.42.120.18
X-Complaints-To: abuse AT home DOT net
X-Trace: news3.rdc1.on.home.com 968830569 24.42.120.18 (Wed, 13 Sep 2000 00:36:09 PDT)
NNTP-Posting-Date: Wed, 13 Sep 2000 00:36:09 PDT
Organization: Excite AT Home - The Leader in Broadband
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Wed, 13 Sep 2000 00:07:01 GMT, Andrew Clark <lark047 AT my-deja DOT com> wrote:

>is there any way to capture the result of compilation to a file? i want
>to store the results, so i'm looking for something like
>gcc foo.c > error.txt, but i tried that and it didn't work. any
>suggestions?

Use redir:

redir -e foo.txt gcc -Wall -ansi foo.c

will create a file called foo.txt which will contain GCC's output.  This is
because GCC writes to STDERR rather than STDOUT.  When I make something and get
a lot of errors, I usually use:

redir -eo make | less

to redirect the messages to STDOUT, piping it into less so I can read at my
leisure.

-- 
AndrewJ

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019