Awk question
Jay Plett
jay at silence.princeton.nj.us
Mon Jan 21 08:33:50 AEST 1991
In article <1991Jan20.062150.24582 at convex.com>, tchrist at convex.COM (Tom Christiansen) writes:
- From the keyboard of bob at wyse.UUCP (Bob McGowen x4312 dept208):
- :In article <1991Jan18.164243.11804 at cbnewsh.att.com> me at 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
More information about the Comp.unix.shell
mailing list