From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,3a88a2329cf02d52 X-Google-Attributes: gidfee84,public From: caccavelli@myna.com (Pasqualino Caccavelli) Subject: Re: Korn shell programming - awk in particular Date: 1997/04/25 Message-ID: <33600093.0@news.myna.com>#1/1 X-Deja-AN: 237152886 References: <5jodsm$df4$1@sue.cc.uregina.ca> Newsgroups: comp.unix.osf.osf1 In article <5jodsm$df4$1@sue.cc.uregina.ca>, MAHENDRA@Meena.CC.URegina.CA (A. Mahendra Rajah) wrote: > > > I am new to Unix and would like to ask 2 questions: > > 1) Is there any good book that will teach me shell programming > using the Korn shell? > > 2) How do I debug this awk problem? > > $ x = "this+is+a+line+with+equals" > > I am trying to replace all the + characters with spaces. > > $ print $x | awk '{ i=gsub("+","",$0) }' > "@awk: There is a regular expression error. > *?+ not preceded by valid expression > The source line number is 1. > The error context is > { i=gsub("+","",$0) >>> <<< > > Any help will be greatly appreciated. > > Thanks, > >----------------------- > mahendra (A. Mahendra Rajah :: Mahendra @ Meena.CC.URegina.CA) > Systems Manager & Postmaster, > Dept of Computing Services, > University of Regina, > Regina, Sask., Canada. >----------------------- > Mahendra, Can't help you with Q1 but as for Q2 maybe you can simplify the process by using sed? $x = "this+is+a+line+with+equals" i=`echo $x | sed 's/^+/ /'` Hope this helps. Lino...