🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#43
From: Eddie Bush
Date: Sun, 31 Mar 1996 12:08
43 lines
1912 bytes
Daniel-Marian Baboiu wrote:
> 
> yuehong wrote:
> >
> > I try to use the following command when I compile hello.cpp
> > using gcc on linux:
> >
> > g++ hello.cpp >bug
> >
> > I thought error might be saved in bug. But, nothing there.
> 
> '>' redirects the standard output; the compiler errors are on the
> standard error; it happens that both are mapped to the screen.
> 
> What you have to do is (if you are using bash as shell)
> g++ hello.cpp >bug 2>&1
> 
> -------------------------------------------------
> Daniel-Marian Baboiu
> University of Central Florida / CREOL
> 4000 Central Florida Blvd
> Orlando, FL 32816-2700
> 407-823-6919       Fax: 407-823-6955
> e-mail: daniel@soliton.creol.ucf.edu
> --------------------------------------------------

another handy way to do this is to generate a script file using (what 
else) the script command.

This works like:

1) type script
2) gcc file.c
3) type exit

The default name for the script is typescript, but if you add a name 
parameter to script, you can change that (ie. "script errors" would 
generate a script named errors) if you like.  This is a handy method - at 
least it is to me.

This only works under Unix though - as far as I know.  Also - and someone 
(like you won't) PLEASE correct me if I am wrong - this should work on 
all UN*X machines.
Technical Details
Message-ID: <315E75D8.4317@sooner.net>
Path: arc1-ca.pugleaf.net!sooner.net!usenet
References: <4igdeo$8tf@news.jhu.edu> <315B1BBF.43215860@soliton.creol.ucf.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sooner.net!usenet
From: Eddie Bush <edwbush@sooner.net>
Newsgroups: comp.os.linux.misc,comp.lang.c++,gnu.gcc.help
Subject: Re: Help: how do you redirect compile error to a file
Date: Sun, 31 Mar 1996 04:08:56 -0800
Organization: sooner.net news site
Message-ID: <315E75D8.4317@sooner.net>
References: <4igdeo$8tf@news.jhu.edu> <315B1BBF.43215860@soliton.creol.ucf.edu>
NNTP-Posting-Host: p28.sooner.net
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 2.0 (Win16; I)