On 2024-05-30 14:56:50 -0600, Todd C. Miller wrote:
> This is not a bug. An awk associative array is effectively a hash
> table so when you iterate over it like this you are not guaranteed
> to get things in any particular order. In fact, our awk, mawk and
> gawk all produce different output when
Hi,
Upon finding out about this "quirk" in the awk language, if you are now
horrified that you
have loads of code that relies on this order, there is a temporary solution.
Check out the
WHINY_USERS environment variable:
https://linux.die.net/man/1/mawk
In mawk and (apparently) undocumented in
Todd,
Thanks for the explanation.
Jeff
On Thu, 30 May 2024 at 21:56, Todd C. Miller wrote:
>
> On Thu, 30 May 2024 21:42:08 +0100, Jeff Penn wrote:
>
> > I spotted the following issue, which is also present in FreeBSD.
> >
> > $ awk -V
> > awk version 20240122
> > $ awk 'BEGIN {split("A B C", AB
On Thu, 30 May 2024 21:42:08 +0100, Jeff Penn wrote:
> I spotted the following issue, which is also present in FreeBSD.
>
> $ awk -V
> awk version 20240122
> $ awk 'BEGIN {split("A B C", ABC, " ");for (x in ABC) {print x}}'
> 2
> 3
> 1
This is not a bug. An awk associative array is effectively a
I spotted the following issue, which is also present in FreeBSD.
$ awk -V
awk version 20240122
$ awk 'BEGIN {split("A B C", ABC, " ");for (x in ABC) {print x}}'
2
3
1
FreeBSD 14, awk 20210724:
$ awk 'BEGIN {split("A B C", ABC, " ");for (x in ABC) {print x}}'
2
3
1
Linux, mawk 1.3.4 20200120:
$ a
5 matches
Mail list logo