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