Awk question

Tom Christiansen tchrist at convex.COM
Sun Jan 20 17:21:50 AEST 1991


>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/".  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 <tchrist at convex.com>)



More information about the Comp.unix.shell mailing list