🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.linux
Article #328

Re: howto move the errors from gcc to a file?

#328
From: loki
Date: Sat, 26 May 2001 09:13
26 lines
1993 bytes
David. E. Goble <goble@gtech> wrote unto us:
>Hi all;
>
>I am just beginning to try programming in linux (redhat).
>
>My problem is when I use gcc ...etc it produces a scolling list of
>errors. How can I move or pipe the errors to a file. ie something like
>
>	gcc -o hello.c > error.txt?

As a final tip to add to the others, sometimes it is nice to both view and
save the output of a program.  The little utility 'tee' is handy for this.
You can use it like this:

gcc -o testprog test.c 2>&1 | tee out.log

The 'tee' program will save what it receives on standard input to the named
file, as well as printing it to the screen.  This often gives you the best
of both worlds with regard to viewing and saving of errors.


-- 
    loki
eloki/at/dingoblue.net.au

Dare I disturb the universe?  You bet I do! :)
Technical Details
Message-ID: <slrn9gucaj.c2k.eloki@hoop.dingoblue.net.au>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!news1.optus.net.au!optus!news1.mpx.com.au.MISMATCH!news01.syd.optusnet.com.au!nnrp01.syd.optusnet.com.au!not-for-mail
References: <3b0d0a50.19718301@news.adelaide.on.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10c696,4d862f9db31ad355
X-Google-Attributes: gid10c696,public
X-Google-Thread: 102983,4d862f9db31ad355
X-Google-Attributes: gid102983,public
X-Google-Thread: 100c5f,4d862f9db31ad355
X-Google-Attributes: gid100c5f,public
X-Google-Thread: f9b51,4d862f9db31ad355
X-Google-Attributes: gidf9b51,public
X-Google-ArrivalTime: 2001-05-26 02:15:02 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!news1.optus.net.au!optus!news1.mpx.com.au.MISMATCH!news01.syd.optusnet.com.au!nnrp01.syd.optusnet.com.au!not-for-mail
From: eloki@dingoblue.net.au-nospam (loki)
Newsgroups: alt.linux,aus.computers.linux,comp.os.linux.development.apps,comp.os.linux.setup
Subject: Re: howto move the errors from gcc to a file?
References: <3b0d0a50.19718301@news.adelaide.on.net>
X-NAPOC: Dead
Message-ID: <slrn9gucaj.c2k.eloki@hoop.dingoblue.net.au>
User-Agent: slrn/0.9.6.2 (Linux)
Date: 26 May 2001 09:13:13 GMT
Lines: 27
NNTP-Posting-Host: 198.142.217.68
X-Trace: 990868393 news01.syd.optusnet.com.au 25503 198.142.217.68