[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] What is wrong with getline from both stdin and a file fro
From: |
Andrew J. Schorr |
Subject: |
Re: [bug-gawk] What is wrong with getline from both stdin and a file from ARGV? |
Date: |
Thu, 29 Nov 2018 08:21:28 -0500 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, Nov 28, 2018 at 10:22:56PM -0600, Peng Yu wrote:
> I see what I was wrong. `getline` will read from ARGV[1] once it has
> been set, even later on ARGV is deleted.
>
> $ printf '%s\n' {1..3} | mawk.sh -e 'BEGIN { getline; print; getline <
> ARGV[2]; print; delete ARGV; getline; print }' <(printf '%s\n' {a..c})
> <(printf '%s\n' {A..C})
> printf '%s\n' {A..C}
> printf '%s\n' {a..c}
> a
> A
> b
Do you not see that the "printf '%s\n' {1..3}" on stdin is irrelevant?
It is just confusing you; awk ignores it.
Regards,
Andy