Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think.com!spool.mu.edu!uunet!uunet.UU.NET!sef From: henry@zoo.toronto.edu (Henry Spencer) Newsgroups: comp.std.unix Subject: Re: awk syntax Message-ID: <1991May14.233011.28643@uunet.uu.net> Date: 14 May 91 16:54:35 GMT References: <1991May13.222855.9433@uunet.uu.net> Sender: usenet@uunet.uu.net (UseNet News) Organization: U of Toronto Zoology Lines: 22 Approved: sef@uunet.uu.net (Moderator, Sean Eric Fagan - comp.std.unix) Originator: sef@uunet.UU.NET Nntp-Posting-Host: uunet.uu.net X-Submissions: std-unix@uunet.uu.net Submitted-by: henry@zoo.toronto.edu (Henry Spencer) In article <1991May13.222855.9433@uunet.uu.net> peter@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@zoo.toronto.edu utzoo!henry Volume-Number: Volume 23, Number 69