Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 exptools 1/6/84; site iwu1a.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!ihnp4!iwu1a!david From: david@iwu1a.UUCP (David Scheibelhut) Newsgroups: net.unix-wizards Subject: Re: Awk bug+fix Message-ID: <173@iwu1a.UUCP> Date: Tue, 6-Mar-84 19:45:58 EST Article-I.D.: iwu1a.173 Posted: Tue Mar 6 19:45:58 1984 Date-Received: Wed, 7-Mar-84 06:30:50 EST References: <2389@hplabs.UUCP> Organization: AT&T Bell Labs, Naperville, IL Lines: 25 The complaint was that the AWK statement: print "data" > "file" sets the file to zero length only if the print is the first to write to the file. This behavior can be considered a bug or feature depending on the point of view. Because subsequent prints append to the file one need not include special code to initialize the file at the start of execution. Instead, by using ">" on all print statements, the file is initialized without special code and contains all output from the last run, the most common need in AWK's transaction-oriented environment. On the other hand these semantics are different those of the shell (where AWK acquired ">") and do not allow AWK to clear a file. Which is best? AWK documentation is vague and allows both interpretations. Thus the proposed change to AWK is not a bug fix but a change to a working tool. Because this change will break many existing AWK programs (including many of mine) and because AWK has been quite static (the latest documentation being written about six years ago) I urge that this "bug" not be fixed. Similar arguments can be made about the other "bugs" which were discussed: the current implementation has advantages and the documentation, although ambiguous, allows the current implementation. David Scheibelhut