awk arguments

Vicki Brown vlb at magic.aux.apple.com
Thu Jul 26 05:51:30 AEST 1990


>From miscellaneous postings Re: awk:

mayne at VSSERV.SCRI.FSU.EDU (William (Bill) Mayne) writes:

>> While I am on the subject of awk: I learned about the language
>> from the book "The AWK Programming Language" by Kernighan et. al.
>> before I started working on unix. I have been disappointed to
>> find that the version actually available on every flavor of unix
>> I have seen is much weaker than the full version described by the

The book is published by Addison-Wesley, 1988.  It is useful for the old
(not the new improved) awk, but covers the updated version because the
authors of the book are the authors of awk.  The book is very good.  If
you use awk, get it.  If you can't believe the new features are useful and
you don't have the book, GET IT.

>> book. Are there better versions out there?

briand at trigraph.uucp (Brian Dickson) writes:
>>> At our site we use nawk, which I believe is public domain. Consult an
>>> archive site near you for more info.

The new version of awk (often called nawk) has been extant since 1985.
"They" (AT&T) did manage to get it into Sys V.3.? and it will be in Sys V.4.
It is NOT public domain; however It is available from the AT&T Toolchest,
in source, for the nominal price of ~$300.  If that bothers you,
the Free Software Foundation (gnu) has a copyleft version called gawk which
they want to be fully compatible.

roger at yuba.wrs.com (Roger Rohrbach) writes:
|> implementation of that language free- GNU awk (gawk).  It chokes on my
|> best work (written in "old awk"), however, so I don't bother with it.

Roger - please send information about such failures to the gnu project.
Their aim is strong, good programs that work.  If gawk chokes on something
that awk handles, let gnu know so they can make things better!

omerzu at quando.quantum.de (Thomas Omerzu) writes:
>I've always been quite satisfied with the
>abilities of 'awk'
>
>- except of one point: the error checking of program scripts.
>You'll nearly ever get 'bailing out near line ...'.
>That point would have been worth of being mentioned in the
>'bug' section of the manual for awk.

Then you'll love the new version! One of the great new features is
CONTEXTUAL error messages:
code:
		BEGIN {
        		next = 7
        		exit
		}
error:
	awk: syntax error at source line 3
 	context is
                	next >>>  = <<<  7
	awk: illegal statement at source line 3

In old awk I get a syntax error and a segmentation fault.

Personally, I think new awk is great (functions, better substitution
capabilities, the cos function works!, etc.).  We've got it in-house
here and I use it all the time.  None of my old scripts have broken yet.

Since AT&T is finally recognizing it, I'd say expect to see it in more
versions of U*X coming along.

By the way, rumor has it that Brian Kernighan says "The name is awk, not
nawk", for which he gets even more of my respect that he already had.
-- vicki



More information about the Comp.unix.wizards mailing list