Strange behaviour of awk

Guy Harris guy at auspex.UUCP
Tue Feb 28 05:03:08 AEST 1989


 >The AWK book says that "when one of $1, $2, etc., is changed, $0 is
 >reconstructed using OFS to separate fields".  So it's definitely a
 >bug.  However, unless you are using System V, you probably have old
 >awk which may have bugs that have been fixed in new awk.  Our (SunOS
 >4.0) old awk suffers the same bug.

The SunOS 4.0 "awk" is based on the S5R2 one (mainly because it's
significantly faster than the version of "old awk" that comes with
4.xBSD); this means it's quite likely that *every* version of "old awk"
has the problem in question.  I hesitate to call it a "bug" unless some
documentation on "old awk" says $0 is reconstructed; the AWK book
describes only "new awk", and describes a *lot* of stuff that doesn't
work in "old awk" because it wasn't in "old awk".



More information about the Comp.unix.questions mailing list