🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.linux.misc
Article #39

Re: Help: how do you redirect compile error to a file

#39
From: Floyd Davidson
Date: Mon, 18 Mar 1996 15:27
28 lines
1167 bytes
fcusack@tdx.org wrote:
>In article <4igdeo$8tf@news.jhu.edu>, yuehong@psi.ece.jhu.edu (yuehong) wrote:
>
>> I try to use the following command when I compile hello.cpp 
>> using gcc on linux:
>> 
>> g++ hello.cpp >bug
>> 
>
>Errors go to stderr, the '>' operator only redirects stdout. If you are
>using sh/ksh/bash/... then you need 
>   
>   g++ hello.cpp >bug 2>&1

And if you do this:

     g++ hello.cpp 2>&1 | tee bug

It will also display on the screen (as well as be sent to a file).
This works fine with make too:

     make 2>&1 | tee make.out

is the way I run make all the time.

  Floyd
-- 
Floyd L. Davidson          Salcha, Alaska         floyd@tanana.polarnet.com
Technical Details
Message-ID: <4ijvdu$8g8@news2.cais.com>
Path: arc1-ca.pugleaf.net!polarnet.com!floyd
References: <4igdeo$8tf@news.jhu.edu> <fcusack-1803960612430001@mudskipper.cac.psu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!polarnet.com!floyd
From: floyd@polarnet.com (Floyd Davidson)
Newsgroups: comp.os.linux.misc,comp.lang.c++,gnu.gcc.help
Subject: Re: Help: how do you redirect compile error to a file
Date: 18 Mar 1996 15:27:58 GMT
Organization: __________
Message-ID: <4ijvdu$8g8@news2.cais.com>
References: <4igdeo$8tf@news.jhu.edu> <fcusack-1803960612430001@mudskipper.cac.psu.edu>
Reply-To: floyd@tanana.polarnet.com
NNTP-Posting-Host: tanana.polarnet.com