Subject: Awk change in 1.3.2
To: None <port-i386@NetBSD.ORG>
From: Terry Moore <tmm@mcci.com>
List: port-i386
Date: 07/02/1998 18:53:22
So, I've upgraded from 1.0, and am putting a machine into production.

We have a number of awk scripts with the construct

	' { blah blah } END {print}'

in them.  The intent is to get an extra newline at the end of the
output file.  (For example, '{ printf("%s\\\n", $1) } END {print}' 
extracts the first field, puts backslashes at the end of each line,
and prints an extra newline.  Good for building makefiles, which is
what I'm doing.

This works great in SunOS 4.1.3 (awk/nawk) and in 1.0 (which has
gawk 2.15 pl 5).

For example,
	echo foo | awk 'END {print}'
prints nothing.
	echo foo | awk '{print} END {print}'
prints one line of 'foo', followed by a blank line.

1.3.2 has upgraded to 2.15 pl 6.  This version has a different behavior,
which may or may not be intended:

	echo foo | awk 'END {print}'

prints 'foo'.

More annoying
	echo foo | awk '{print} END {print}'
prints
	foo
	foo

I think this is a bug; it's certainly an annoying compatibility problem.
I can work around by reverting to the old version of awk, but....
should I send-pr this?

--Terry