Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!dsl.pitt.edu!pitt!amanue!oglvee!norm From: norm@oglvee.UUCP (Norman Joseph) Newsgroups: comp.unix.questions Subject: Re: awk Question Message-ID: <525@oglvee.UUCP> Date: 10 Jan 90 14:49:37 GMT References: <3384@linus.SLCS.SLB.COM> Distribution: usa Organization: Oglevee Computer Systems, Connellsville, Pa Lines: 26 In <3384@linus.SLCS.SLB.COM>, by oneill@getafix.slcs.slb.com (Dennis O'Neill): > > [writing about parsing multi-line records with awk, and getting a > syntax error on a line using the gsub() function call:] > > {gsub(/\\\\/, ""); print $0} > > [generates:] > > awk: syntax error near line 1 > awk: illegal statement near line 1 On my system (Altos running Unix 5.3.1) there are two versions of awk, namely "awk" and "nawk" (new awk). Apparently nawk is the latest version of awk as described in the book _The_AWK_Programming_Language_ by Aho, Kernighan, & Weinberger, and includes gsub() as a builtin function, while plain old awk does not. My suspicion is that you are using the old awk. -- Norm Joseph - Oglevee Computer System, Inc. UUCP: ...!{pitt,cgh}!amanue!oglvee!norm /* you are not expected to understand this */