home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!mips!swrinde!network.ucsd.edu!jwp
- From: jwp@chem.ucsd.edu (John Pierce)
- Newsgroups: comp.unix.aix
- Subject: 3.2.2 awk
- Message-ID: <1715idINN9o0@network.ucsd.edu>
- Date: 20 Aug 92 22:15:41 GMT
- Organization: Chemistry Dept, UC San Diego
- Lines: 24
- NNTP-Posting-Host: chedccf0.ucsd.edu
-
- We just installed 3.2.2 and found that awk was broken. This has been reported
- via aixserv as problem 6X613. The problem is that awk may set NF incorrectly
- under certain conditions. When an explicit field separator is given (with the
- -F command line option, or by assignment to FS), NF is set incorrectly if the
- final field is null. Given the script
-
- awk -Fx '{print $0 "\t: NF = " NF}' -
-
- and the input 1x2x3
- x2x3
- x2x
-
- the output is 1x2x3 : NF = 3
- x2x3 : NF = 3
- 1x2x : NF = 2
- 1xx : NF = 2 <--- Incorrect
- x2x : NF = 2 <--- Incorrect
- xxx : NF = 3
-
- The output for the third line is clearly incorrect. This problem did not
- exist in 3.1.x, nor does it exist on SUNs, etc.
-
- -- John W Pierce, Chemistry, UC San Diego
- jpierce@ucsd.edu
-