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

  1. Path: sparky!uunet!munnari.oz.au!samsung!transfer!jjmhome!alden!alden.UUCP
  2. From: sgr@alden.UUCP (Stan Ryckman)
  3. Newsgroups: comp.unix.questions
  4. Subject: Re: Awk Variables
  5. Message-ID: <510@alden.UUCP>
  6. Date: 12 Aug 92 18:04:57 GMT
  7. References: <1992Aug7.150523.14912@unx.ucc.okstate.edu> <1992Aug10.003934.24269@jpradley.jpr.com>
  8. Sender: usenet@alden.UUCP
  9. Organization: Alden Electronics, Westboro, MA
  10. Lines: 32
  11.  
  12. In article <1992Aug10.003934.24269@jpradley.jpr.com> jpr@jpradley.jpr.com (Jean-Pierre Radley) writes:
  13. [...stuff deleted...]
  14. >RTFM. It's in there.
  15. >
  16. >awk '
  17. >...awk stuff to be done...
  18. >' var1=value1 var2=value2 file[s]
  19. >
  20. >-- 
  21. >Jean-Pierre Radley   Unix in NYC   jpr@jpr.com   jpradley!jpr   CIS: 72160,1341
  22.  
  23. Not necessarily!  Old awk's don't take var1=value1 type arguments.
  24.  
  25. *** BEGIN GRIPE ***
  26.  
  27. BTW, when this "enhancement" was invented, why didn't the brilliant
  28. person make it backwards compatible?  i.e.,
  29.     awk -f awk_script a=2
  30. FORMERLY read input from file "a=2" (a legal filename, after all.)
  31. Newer awks don't; they read from standard input after setting variable
  32. a to value 2.  It would have been so simple to require something like:
  33.     awk -f awk_script -set a=2
  34. (substitute any previously-unused switch for "-set") if you
  35. wanted to set variable a to value 2, and then the behavior of both
  36. old and new awks for the first line above would have been the same.
  37.  
  38. *** END OF GRIPE ***
  39.  
  40. Stan.
  41. --
  42. This .signature has expired.  Call 1-900-YOU-FOOL to find out why.
  43.     Stan Ryckman   sgr@alden.UUCP
  44.