AWK User Assistance

Wolf N. Paul wnp at dcs.UUCP
Sat Apr 23 23:54:53 AEST 1988


In article <307 at dsacng1.UUCP> nab1382 at dsacng1.UUCP (Dick Hauser) writes:
 >I purchased the book "The AWK Programming Language".  Right now,
 >I am working my way through the book.  I have encountered problems
 >with user-defined functions (Page 53).  I am familiar with "C" ...
 >     { init_rpt()
 >       print $1, $2 $3
 >     }
 >     function init_rpt {
 >	print "      SAMPLE HEADER"
 >     }
 >As a last resort, I wrote a small program like the one above, but
 >still received errors (syntax error near xxx, bailing out near xxx).
 >I read paragraph 2.3 (User-Defined Functions) quite a few times, and
 >can locate the problem.  Apparently, there is a syntax requirement
 
The syntax requirement is to have the right version of AWK. The AWK distributed
with most UNIX systems to date is not the latest version of AWK, and supports
neither user-defined functions nor access to more than one file in a program.
I believe that the latest version, as described in the book, is being
distributed with System V/3 only; it is also available from the AT&T Toolchest,
although I do not know quite what the requirements are for that.

If you have a 286 running either Microport or Xenix System V, you can get
a reverse-engineered workalike from Mortice Kern Systems in Waterloo, Ontario,
UNIX mail address ihnp4!watmath!mks!toolkit. Cost for a package including
AWK, KSH and CRYPT is ca. $99.

Hope this saves some readers of the AWK book these same frustrations I went
through until I discovered that I had the wrong version of awk.
-- 
Wolf N. Paul * 3387 Sam Rayburn Run * Carrollton TX 75007 * (214) 306-9101
UUCP:  ihnp4!killer!dcs!wnp                    ESL: 62832882
INTERNET: wnp at EESDES.DAS.NET or wnp at dcs.UUCP   TLX: 910-280-0585 EES PLANO UD



More information about the Comp.unix.questions mailing list