[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] gawk 4.0 bug when getline is in BEGIN
From: |
Andrew J. Schorr |
Subject: |
Re: [bug-gawk] gawk 4.0 bug when getline is in BEGIN |
Date: |
Tue, 20 Mar 2012 21:19:48 -0400 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hi Karl,
On Tue, Mar 20, 2012 at 11:00:40PM +1100, Karl Smith wrote:
> BUG : when getline is in the BEGIN block it reads two lines instead of one
> as the attached program demonstrates
This is a known bug that was patched a while ago, as discussed below.
Regards,
Andy
On Tue, Feb 07, 2012 at 10:32:45PM +0200, Aharon Robbins wrote:
> Hi. Re this. It's a bug, fixed already in the git repo. The
> best way to get an up to date version is to use git to get the
> source, then
>
> git checkout gawk-4.0-stable
> ./bootstrap.sh
> ./configure && make && make check
>
> Thanks,
>
> Arnold
>
> > Date: Mon, 6 Feb 2012 15:05:49 +0100
> > From: Goran ??engi?? <address@hidden>
> > To: address@hidden
> > Subject: [bug-gawk] Is this a bug?
> >
> > I try running this script with GNU Awk 4.0.0 distributed with Cygwin
> >
> >
> > #!/bin/awk -f
> >
> > BEGIN {
> > getline
> > }
> >
> > {
> > print $0
> > }
> >
> >
> > on an example file like this
> >
> >
> > 0
> > 1
> > 2
> > 3
> > 4
> > 5
> > 6
> >
> >
> > and I get
> >
> >
> > 2
> > 3
> > 4
> > 5
> > 6
> >
> > I know that line "0" got consumed by the getline but what happened to line
> > "1"?
> >
> > Kind regards,
> >
> > Goran
> > --
> > Goran ??engi??
> > Gibraltargatan 40
> > 412 58 G??teborg
> >
> > mob: 073-9037010
> >
> > Have a nice day :)