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

  1. Path: sparky!uunet!mcsun!uknet!root44!gwc
  2. From: gwc@root.co.uk (Geoff Clare)
  3. Newsgroups: comp.unix.questions
  4. Subject: Re: Awk Variables
  5. Message-ID: <Bt6v2A.6CM@root.co.uk>
  6. Date: 18 Aug 92 16:56:33 GMT
  7. References: <1992Aug7.150523.14912@unx.ucc.okstate.edu> <1992Aug10.003934.24269@jpradley.jpr.com> <510@alden.UUCP>
  8. Organization: UniSoft Ltd., London, England
  9. Lines: 25
  10.  
  11. In <510@alden.UUCP> sgr@alden.UUCP (Stan Ryckman) writes:
  12.  
  13. >  Old awk's don't take var1=value1 type arguments.
  14.  
  15. >*** BEGIN GRIPE ***
  16.  
  17. >BTW, when this "enhancement" was invented, why didn't the brilliant
  18. >person make it backwards compatible?  i.e.,
  19. >    awk -f awk_script a=2
  20. >FORMERLY read input from file "a=2" (a legal filename, after all.)
  21. >Newer awks don't; they read from standard input after setting variable
  22. >a to value 2.
  23.  
  24. I expected to see this guy flamed to a crisp but I haven't seen a single
  25. followup here, so I'll stick my oar in.
  26.  
  27. Old awks DO take var=value arguments.  I have never come across a version
  28. of awk that did not.  The only difference in this feature between old and
  29. new awk is that if you want to set a variable on the command line AND
  30. read standard input, you have to put an explicit "-" as a file name with
  31. old awks, but new awks shouldn't need it.
  32.  
  33. -- 
  34. Geoff Clare <gwc@root.co.uk>  (USA UUCP-only mailers: ...!uunet!root.co.uk!gwc)
  35. UniSoft Limited, London, England.   Tel: +44 71 729 3773   Fax: +44 71 729 3273
  36.