[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: parsing getline var argument
From: |
Jürgen Kahrs |
Subject: |
Re: parsing getline var argument |
Date: |
Mon, 13 Aug 2007 17:45:52 +0200 |
User-agent: |
Thunderbird 1.5.0.8 (X11/20060911) |
Joel E. Denny wrote:
> Recent releases of GAWK behave in the same way, but this behavior differs
> from /usr/bin/awk under Solaris 10:
>
> % /usr/bin/awk '{getline $4; print $4;}' > stdout
> line 1
> line 2
> % od -c stdout
> 0000000 \n
> 0000001
The awk on Solaris is an oawk (old awk as of 1978).
getline was introduced in 1985, but Sun chose to
ignore this for more than 20 years now.
> What is the correct behavior? Is `getline $4;' a GNU extension? Or is
> the behavior undefined here?
The behavior is defined and GAWK behaves correctly.