bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] File partial overwrite when using join


From: Wolfgang Laun
Subject: Re: [bug-gawk] File partial overwrite when using join
Date: Fri, 5 Feb 2016 17:51:13 +0100

gawk is not to be blamed.

join requires the files to be sorted on the "key" field.

Cheers
Wolfgang


On 4 February 2016 at 06:56, <address@hidden> wrote:
This is part of an Gawk program I wrote to find new ebuilds (Gentoo
equivalent of rpm spec) on an as wanted basis vs using esync and having
to check for them immediately.
I left all debug and return checking code in so you can see what happens.
I'm not certain if this odd behaviour is due to Gawk or join or something
else.
What happens is this:
You run the awk program and instead of printing out:

1 NEW PACKAGES
app/zaz [ masked ]
2 REMOVED PACKAGES
app/bar

You get:

1 NEW PACKAGES
2 REMOVED PACKAGES
app/bar

Technically you get more output then that, but that'd because this little
snippet is trying to be informative. If you uncomment the marked line the
case gets even weirder as Gawk overwrites instead of appending to the
file. I tried using sync and fflush to no avail.
I've attacked all three files so you can try it yourself. You'll
need to change the dir variable to reflect your own environment.
I also tried nawk but it did the same thing.
I'm using Gawk 4.0.2 .
Coreutils 8.23 .
bash 4.3.42 (my package manager calls it 4.3_p42-r1).
For the bandwidth limited the attachments plus this email are about
1.5KiB, the program snippet is only 50 lines.

Thanks, David


reply via email to

[Prev in Thread] Current Thread [Next in Thread]