delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/05/07/10:01:27

Date: Wed, 07 May 2003 16:56:30 +0300
From: "Eli Zaretskii" <eliz AT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: djgpp AT delorie DOT com
Message-Id: <2427-Wed07May2003165629+0300-eliz@elta.co.il>
X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9
In-reply-to: <3EB8F9A6.4050307@lml.ls.fi.upm.es> (message from Manuel Collado
on Wed, 07 May 2003 14:18:46 +0200)
Subject: Re: gawk 3.1.1: bug in stdout redirection on WinNT 4.0
References: <3EB7C0D6 DOT 7030206 AT lml DOT ls DOT fi DOT upm DOT es> <9003-Tue06May2003200634+0300-eliz AT elta DOT co DOT il> <3EB8F9A6 DOT 4050307 AT lml DOT ls DOT fi DOT upm DOT es>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Date: Wed, 07 May 2003 14:18:46 +0200
> From: Manuel Collado <m DOT collado AT aaron DOT ls DOT fi DOT upm DOT es>
> Newsgroups: comp.os.msdos.djgpp
> > 
> > You are using the quote characters inside quoted strings; DOS/Windows
> > shells do not cope well with these.  I suggest to try these commands
> > instead:
> > 
> >   gawk 'BEGIN {printf(\"================first\")}'> out.txt
> >   gawk 'BEGIN {printf(\"++++second+\");}'>> out.txt
> > 
> > That is, use single quotes instead of double quotes for the outer
> > quotes.  That should work in either shell.
> 
> No, the bug has been found by executing awk scripts stored in files.

Then please show an example of this bug that doesn't use command-line
argument quoting.

> Apparently it may be an issue related to how the externally redirected 
> stdout handler is passed to gawk. And using bash or the native command 
> shell makes a difference.
> 
> For DJGPP gawk 3.1.1 on WinNT 4.0, what I find is that any redirection 
> of the form
> 
>      gawk ..... >> outfile
> 
> always overwrites outfile from the beginning, but preserving the non 
> overwritten contents.

Redirection from the command line has nothing to do with Gawk (or any
DJGPP program).  The redirection is done by the shell you are using,
either Bash or CMD.EXE.  It's possible that CMD.EXE from NT4 has
problems with redirection when it runs DOS programs (I think I've
heard in the past a couple of reports along these lines, but I'm not
sure).

- Raw text -


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