delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/11/07/13:04:55

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <09719EC6B8C4D5119A7600D0B76FDDE10B83DA@cpex3.channelpoint.com>
From: Troy Noble <troy DOT noble AT channelpoint DOT com>
To: "'Robinow, David'" <drobinow AT dayton DOT adroit DOT com>,
"'Morten Nygaard Aasnes'" <mortenn AT imr DOT no>, cygwin AT cygwin DOT com
Subject: RE: 1.3.1: printf bug in awk?
Date: Wed, 7 Nov 2001 11:04:36 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
X-Scanned-By: MIMEDefang 1.0 (http://www.roaringpenguin.com/mimedefang/)

Good point.  The default install prefix in gawk-3.1.0/configure
is /usr/local.  So depending on whether you have /usr/local/bin
before /usr/bin on your PATH you'd get the newer gawk vs cygwin-supplied
gawk 3.0.4.

And then there's the whole issue of whether to uninstall the 3.0.4
first before "make install" to ensure any remaining cruft gets cleaned
up... which is a whole other topic entirely.

That's why I stopped short of recommending "make install".  I
assumed the exercise was up to the reader... I guess I assume too
much.  Maybe I've been compiling GNU stuff from sources for too
long now ;->

Thanks for pointing that out.

Troy

-----Original Message-----
From: Robinow, David [mailto:drobinow AT dayton DOT adroit DOT com]
Sent: Wednesday, November 07, 2001 10:58 AM
To: 'Morten Nygaard Aasnes'; cygwin AT cygwin DOT com
Subject: RE: 1.3.1: printf bug in awk?


 Yes.  But you might want to try
   ./configure --prefix=/usr
 or you might find yourself still running gawk 3.0.4
 Or, you might not.

-----Original Message-----
From: Troy Noble [mailto:troy DOT noble AT channelpoint DOT com]
Subject: RE: 1.3.1: printf bug in awk?

Seems like a gawk bug, not specific to cygwin.  I get the
same result with gawk 3.0.4 on Linux and Solaris:

bash-2.04$ awk 'BEGIN {printf "%10.0f\n",3.14; exit}'
0000000003

Seems to be fixed in gawk-3.1.0 at least.  I just downloaded and
built it with latest cygwin and I get:

.../gawk-3.1.0$ ./gawk.exe 'BEGIN {printf "%10.0g\n",3.14; exit}'
         3
Perhaps you could convince the cygwin gawk package maintainer to
update to 3.1.0.  But in the meantime, you can compile 3.1.0 yourself
to work around the problem.  If you've done a full cygwin install,
it's literally as simple as download and then ./configure ; make 

Troy

-----Original Message-----
From: Morten Nygaard Aasnes [mailto:mortenn AT imr DOT no]
Subject: 1.3.1: printf bug in awk

There seems to be a bug in GNU Awk 3.0.4 comming with Cygwin 1.3.4.
Using printf with precision 0, it fills with zeros instead of spaces.

  $ awk 'BEGIN {printf "%10.0f\n",3.14; exit}'
  0000000003

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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