Bug 820550 - gawk: getline in BEGIN skips 2 lines
gawk: getline in BEGIN skips 2 lines
Product: Fedora
Classification: Fedora
Component: gawk (Show other bugs)
x86_64 Linux
unspecified Severity high
: ---
: ---
Assigned To: Martin Bříza
Fedora Extras Quality Assurance
Depends On: 808005
  Show dependency treegraph
Reported: 2012-05-10 07:37 EDT by James Hogan
Modified: 2012-06-27 23:35 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-06-27 23:20:27 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description James Hogan 2012-05-10 07:37:19 EDT
Description of problem:

A getline in the BEGIN section seems to eat 2 lines instead of 1 from the point of view of the main section. This works correctly on Centos 6 (GNU Awk 3.1.7).

Version-Release number of selected component (if applicable):
GNU Awk 4.0.0

How reproducible:

Steps to Reproduce:
{ echo "line 1"; echo "line 2"; echo "line 3"; } | awk 'BEGIN { getline } { print $0 }'

Actual results (GNU Awk 4.0.0):
line 3

Expected results (GNU Awk 3.1.7):
line 2
line 3
Comment 1 James Hogan 2012-05-11 08:22:12 EDT
To quote Aharon Robbins on gawk-bugs list (http://lists.gnu.org/archive/html/bug-gawk/2012-05/msg00009.html):

Hi. Thanks for the bug report.

This bug is fixed in gawk 4.0.1, which I released a few weeks ago.
The correct option for Redhat is to simply upgrade to the new release.

Thanks again for taking the time to send in a report.

Comment 2 Martin Bříza 2012-06-06 09:20:07 EDT
The component has changed its owner to me, so I'm assigning the bug to myself.
Comment 3 Fedora Update System 2012-06-07 08:06:25 EDT
gawk-4.0.1-1.fc17 has been submitted as an update for Fedora 17.
Comment 4 Fedora Update System 2012-06-07 08:07:46 EDT
gawk-4.0.1-1.fc16 has been submitted as an update for Fedora 16.
Comment 5 Fedora Update System 2012-06-07 18:55:49 EDT
Package gawk-4.0.1-1.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing gawk-4.0.1-1.fc16'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 6 James Hogan 2012-06-08 05:12:59 EDT
Thanks, gawk-4.0.1-1.fc16.x86_64 fixes this issue for me.
Comment 7 Fedora Update System 2012-06-27 23:20:27 EDT
gawk-4.0.1-1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 8 Fedora Update System 2012-06-27 23:35:01 EDT
gawk-4.0.1-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.