[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gawk] File partial overwrite when using join
From: |
doark |
Subject: |
[bug-gawk] File partial overwrite when using join |
Date: |
Thu, 4 Feb 2016 00:56:12 -0500 |
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
aa.awk
Description: application/awk
tmp2.txt
Description: Text document
tmp5.txt
Description: Text document
- [bug-gawk] File partial overwrite when using join,
doark <=