Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!richsun!richsun.cpg.trs.reuter.com From: boi@richsun.cpg.trs.reuter.com (Ken Boi) Newsgroups: comp.unix.questions Subject: AWK Language Question Message-ID: <972@richsun.cpg.trs.reuter.com> Date: 10 Aug 90 22:25:24 GMT Sender: news@richsun.cpg.trs.reuter.com Distribution: usa Organization: Rich Inc., Oakbrook,IL Lines: 13 According to the book "The AWK Programming Language", there are built-in string functions. One of them is 'gsub'. I have tried using it with the following comand line statement which is very close to the example in the book: awk '{ gsub(/USA/, "United States"); print }' awkdata where 'awkdata' is any text file. I get the error messages: awk: syntax error near line 1 awk: illegal statement near line 1 Anybody know why?