Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!sun-barr!cs.utexas.edu!husc6!rice!sun-spots-request From: hodge!jdm@uunet.uu.net (James D. Murray) Newsgroups: comp.sys.sun Subject: Help with AWK Keywords: 386i Message-ID: <4124@kalliope.rice.edu> Date: 11 Jun 89 02:46:06 GMT Sender: usenet@rice.edu Organization: Sun-Spots Lines: 27 Approved: Sun-Spots@rice.edu X-Sun-Spots-Digest: Volume 8, Issue 50, message 7 of 12 I have been attempting to teach myself AWK on a Sun 386i running SunOS 4.0.1. After entering numerous examples of AWK code from the book "The AWK Programming Language" by Aho, Kernighan, and Weinberger, I find that none of them run! I get error messages complaining about expressions and syntax and none of the messages give me an indication of a definitive problem. I wrote an AWK program to replace a specific character in a file with another: /;/ { sub(/;/, "X", $0) } # replace all ; with X and AWK choked on the sub() function. Likewise AWK dosen't seem to recognise "getline", "gsub", "index", "substr", etc. Does SunOS come with an older version of AWK that does not implement these functions? If not, what is going wrong? jdm@hodge.cts.com [uunet zardoz]!hodge!jdm James D. Murray, Ethnounixologist Hodge Computer Research Corporation 1588 North Batavia Street Orange, California 92667 USA TEL: (714) 998-7750 Ask for James FAX: (714) 921-8038 Wait for the carrier #!