[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gawk] Problem with array index in connection with "sorted_in"
From: |
Christian Schneider |
Subject: |
[bug-gawk] Problem with array index in connection with "sorted_in" |
Date: |
Wed, 20 Jul 2016 18:56:30 -0700 |
User-agent: |
KMail/1.13.7 (Linux/3.4.111; KDE/4.8.4; x86_64; ; ) |
Hi all,
I encountered a change of the behaviour of gawk after upgrading from
version 4.0.1 to 4.1.1, which is most likely not intended. Here is an
example script:
echo -ne "1.0\n2.0\n" | gawk '
BEGIN {
PROCINFO["sorted_in"] = "@ind_num_asc"
}
{
A[$1] = 0
}
END {
for (I in A) B[I] = A[I]
for (I in B) SCRATCH = A[I]
for (I in A) print I
}'
With gawk 4.0.1 (Debian 7) the output is:
1.0
2.0
With gawk 4.1.1 (Debian 8) the output is:
1
1.0
2
2.0
However, you will get the old behaviour, if you comment the
"PROCINFO" line.
I would appreciate your feedback and opinion. Please CC me in your
reply, as I am not subscribed to the list.
Thank you very much,
Christian
- [bug-gawk] Problem with array index in connection with "sorted_in",
Christian Schneider <=