Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pasteur!ucbvax!hplabs!hpda!hpcupt1!hpsal2!morrell From: morrell@hpsal2.HP.COM (Michael Morrell) Newsgroups: comp.unix.questions Subject: Re: AWK User Assistance Message-ID: <2450008@hpsal2.HP.COM> Date: 22 Apr 88 18:32:46 GMT References: <307@dsacng1.UUCP> Organization: HP System Architecture Lab, Cupertino Lines: 28 / hpsal2:comp.unix.questions / nab1382@dsacng1.UUCP (Dick Hauser) / 6:06 am Apr 21, 1988 / 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" and the bourne shell. I wrote a small AWK program which called a user-define function. Syntax errors keep occurring. { 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 I am not aware of. Finally, I you have a list of AWK "gotchas", I would appreciate receiving a copy. Thanks in advance - Dick Hauser ---------- User-defined functions are only available in the 1985 version of awk (nawk). You need to get a copy of that version. Michael