Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!njin!princeton!silence!jay From: jay@silence.princeton.nj.us (Jay Plett) Newsgroups: comp.unix.shell Subject: Re: Awk question Message-ID: <681@silence.princeton.nj.us> Date: 20 Jan 91 21:33:50 GMT References: <1991Jan18.164243.11804@cbnewsh.att.com> <3094@wyse.wyse.com> <1991Jan20.062150.24582@convex.com> Distribution: usa Organization: home Lines: 20 In article <1991Jan20.062150.24582@convex.com>, tchrist@convex.COM (Tom Christiansen) writes: - 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/". - - And if like so many all you have is the old awk, get gawk, which is free. Either nawk or gawk are worth having. But I don't believe that either of them will solve the stated problem. I've never been able to find a way to use a variable on the right-hand side of a ~ expression with any of the incarnations of awk. Have I missed something? ...jay