🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.linux
Article #301

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

#301
From: Terry Porter
Date: Tue, 05 Jun 2001 03:40
61 lines
3094 bytes
On Mon, 4 Jun 2001 10:41:30 +0300, Naftali Salz <salz@menix.bgu.ac.il> wrote:
> 
> 
> if you use tcsh use gcc -o testprog.c | & less
> then you can scroll up and down the error list and when you are done
> simply press Q.
> 
> 
> 
> On 26 May 2001, loki wrote:
> 
>> 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?

If you use the bash shell (most common) then do this ?

gcc -0 hello.c 2> error.txt

The "2" tells the bash shell to re direct *errors* to "error.txt"

(page 98, "Running Linux"  O'Rielly and assoc)

>>
>> 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! :)
>>
>>
> 


-- 
Kind Regards
Terry
--
****                                                  ****
   My Desktop is powered by GNU/Linux.   
   1972 Kawa Mach3, 1974 Kawa Z1B, .. 15 more road bikes..
   Current Ride ...  a 94 Blade
Free Micro burner: http://jsno.downunder.net.au/terry/          
** Registration Number: 103931,  http://counter.li.org **
Technical Details
Message-ID: <slrn9hol7p.7if.tjporter@gronk.porter.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!howland.erols.net!portc.blue.aol.com.MISMATCH!portc03.blue.aol.com!uunet!dca.uu.net!newsfeed.ozemail.com.au!nsw.nnrp.telstra.net!news01.syd.optusnet.com.au!nnrp01.syd.optusnet.com.au!not-for-mail
References: <3b0d0a50.19718301@news.adelaide.on.net> <slrn9gucaj.c2k.eloki@hoop.dingoblue.net.au> <Pine.SGI.4.33.0106041040290.380689-100000@menix.bgu.ac.il>

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: f9b51,4d862f9db31ad355
X-Google-Attributes: gidf9b51,public
X-Google-Thread: 100c5f,4d862f9db31ad355
X-Google-Attributes: gid100c5f,public
X-Google-ArrivalTime: 2001-06-04 20:45:01 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!howland.erols.net!portc.blue.aol.com.MISMATCH!portc03.blue.aol.com!uunet!dca.uu.net!newsfeed.ozemail.com.au!nsw.nnrp.telstra.net!news01.syd.optusnet.com.au!nnrp01.syd.optusnet.com.au!not-for-mail
Newsgroups: alt.linux,aus.computers.linux,comp.os.linux.development.apps,comp.os.linux.setup
From: tjporter@gronk.porter.net (Terry Porter)
Subject: Re: howto move the errors from gcc to a file?
References: <3b0d0a50.19718301@news.adelaide.on.net> <slrn9gucaj.c2k.eloki@hoop.dingoblue.net.au> <Pine.SGI.4.33.0106041040290.380689-100000@menix.bgu.ac.il>
Reply-To: No-Spam
Message-ID: <slrn9hol7p.7if.tjporter@gronk.porter.net>
User-Agent: slrn/0.9.7.0 (Linux)
Date: 05 Jun 2001 03:40:31 GMT
Lines: 61
NNTP-Posting-Host: 198.142.18.28
X-Trace: 991712431 news01.syd.optusnet.com.au 25468 198.142.18.28