This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
RE: 1.3.1: printf bug in awk?
- To: 'Morten Nygaard Aasnes' <mortenn at imr dot no>, cygwin at cygwin dot com
- Subject: RE: 1.3.1: printf bug in awk?
- From: "Robinow, David" <drobinow at dayton dot adroit dot com>
- Date: Wed, 7 Nov 2001 12:57:56 -0500
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.noble@channelpoint.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@imr.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/