Richard wrote:
You can do almost anything in awk. ;-)
As long as you don't need to add using it.
I had to maintain several reports generated by awk, and infrequently
it would add a few three digit numbers together, and end up with
a 10 digit number. Switching through various versions (awk, gawk,
mawk, etc.) and updates all had the same problem. Re-running it on
the same input would usually get the right number. Apparently the
bug was based on the phase of the moon. Rewriting in perl fixed
the problem for good.
The programs were essentially a simple 'BEGIN{total = 0) ...
{total += $3} ... END{print total}' called from a csh script.
(csh doesn't know how to add floating point numbers, so you
have to call an external program to do it for you)