awk syntax

Henry Spencer henry at zoo.toronto.edu
Wed May 15 02:54:35 AEST 1991


Submitted-by: henry at zoo.toronto.edu (Henry Spencer)

In article <1991May13.222855.9433 at uunet.uu.net> peter at ficc.ferranti.com (Peter da Silva) writes:
>>  awk 'BEGIN { print "hi" }   END { print "bye" }'   [not legal?]
>
>It isn't? I use the latter all the time!

You obviously missed that sparkling gem of technical presentation, "Awk
as a serious systems programming language", my paper at the last Usenix. :-)
I raised this specific issue as a needless incompatibility between different
awks.  The problem is that awk has never been specified precisely enough to
definitively say that this was not legal, and it worked in a lot of the early
awks, so people got used to it.  At least one more recent interpretation,
reading the rather fuzzy documentation narrowmindedly, has outlawed it.
Alas, it sounds like POSIX is legitimizing this mistake, thereby breaking
quite a bit of existing practice.
-- 
And the bean-counter replied,           | Henry Spencer @ U of Toronto Zoology
"beans are more important".             |  henry at zoo.toronto.edu  utzoo!henry


Volume-Number: Volume 23, Number 69



More information about the Comp.std.unix mailing list