home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / aix / 8962 < prev    next >
Encoding:
Internet Message Format  |  1992-08-20  |  1.1 KB

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