Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!swrinde!cs.utexas.edu!convex!news From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.unix.shell Subject: Re: Awk question Message-ID: <1991Jan20.062150.24582@convex.com> Date: 20 Jan 91 06:21:50 GMT References: <1991Jan18.164243.11804@cbnewsh.att.com> <3094@wyse.wyse.com> Sender: news@convex.com (news access account) Reply-To: tchrist@convex.COM (Tom Christiansen) Distribution: usa Organization: CONVEX Software Development, Richardson, TX Lines: 22 Nntp-Posting-Host: pixel.convex.com From the keyboard of bob@wyse.UUCP (Bob McGowen x4312 dept208): :In article <1991Jan18.164243.11804@cbnewsh.att.com> me@cbnewsh.att.com (william.j.bruncati) writes: :>This doesn't work. It won't give me a match although there is one. :> if (myarray[i] ~ /$1/ ) :> print $0 : : I believe this is because you are using "old" awk, which did not : allow substitution into patterns, as with your "/$1/". Check to : see if you have executables named "oawk" and "nawk". If so, "oawk" : will most likely be linked to "awk", so you will want to change : the command to "nawk". : And if like so many all you have is the old awk, get gawk, which is free. You can also get perl, is a proper superset of all the awks (it comes with awk-to-perl and sed-to-perl translators) and is also free. --tom -- "Hey, did you hear Stallman has replaced /vmunix with /vmunix.el? Now he can finally have the whole O/S built-in to his editor like he always wanted!" --me (Tom Christiansen )