delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/09/28/22:58:12

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-Id: <199909290257.VAA00641@mercury.xraylith.wisc.edu>
To: JSONCRAIG AT aol DOT com
cc: fortinj AT ibm DOT net, cygwin AT sourceware DOT cygnus DOT com
Subject: error redirection for win9x command shell [Re: Ouptput question]
In-Reply-To: Your message of "Tue, 28 Sep 1999 21:36:33 EDT."
<b5390d85 DOT 2522c721 AT aol DOT com>
Date: Tue, 28 Sep 1999 21:57:31 -0500
From: Mumit Khan <khan AT thor DOT xraylith DOT wisc DOT edu>

JSONCRAIG AT aol DOT com writes:
> c++ -o foo.exe -g -v foo.cpp 2>&1 | tee out.txt
> 
> the last two lines of output are this:
>      as -o C:\WINDOWS\TEMP\ccR9Mhgb.o C:\WINDOWS\TEMP\ccI0Figb.s
>     Bad command or file name
> 
> The file &1 is created and out.txt is not.  I'm using GCC-2.95 Mingw32, from 
> Mumits site.  Any ideas?
> 

I understand that NT CMD.EXE can redirect standard error as well, but
Win9x COMMAND has no concept of a separate standard error and you need
to use redir (see below).

For NT CMD:

  C:\> gcc [ ... ] 2> err.log 

to just put the error messages in err.log. To redirect both the standard 
output and standard error:

  C:\> gcc [ ... ] > err.log 2>&1

I haven't tried this, so sorry if the syntax is not quite correct.

For mingw32, I adapted DJ's redir; source/binary/doc available from
ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/ports/redir.zip

Regards,
Mumit

ps: I've changed the subject to help our friend the search engine.


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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