This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

error redirection for win9x command shell [Re: Ouptput question]


JSONCRAIG@aol.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@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]