Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ukma!tut.cis.ohio-state.edu!rutgers!rochester!quiroz From: quiroz@cs.rochester.edu (Cesar Quiroz) Newsgroups: gnu.utils.bug Subject: GAWK--possible parser bug Summary: $2-1900 != $2 - 1900 Message-ID: <1989Apr14.132352.27070@cs.rochester.edu> Date: 14 Apr 89 17:23:52 GMT Reply-To: quiroz@cs.rochester.edu (Cesar Quiroz) Distribution: na Organization: U of Rochester, Dept. of Computer Science, Rochester, NY 14627 Lines: 26 This affects 2.10 (and also 2.02) compiled for a Sun 3 running SunOS 3.4. Gawk was compiled by gcc 1.34. Credit for finding this bug goes to Ken Yap. $ gawk ' > { x = $2-1900; print x; print $2 - 1900; } > ' * 0 1989 0 -1900 89 $ /bin/awk ' > { x = $2-1900; print x; print $2 - 1900; } > ' * 0 1989 0 89 89 (lines with a * are input to gawk, the other two are the print outputs) Things work if the bogus subtraction is written ($2)-1900. All of this evidence points to some bogus parse. -- Cesar Augusto Quiroz Gonzalez Department of Computer Science University of Rochester Rochester, NY 14627