variables in awk
Phil Hughes
fyl at ssc.UUCP
Sat Apr 29 07:54:10 AEST 1989
In article <10029 at burdvax.PRC.Unisys.COM>, lang at sirius.PRC.Unisys.COM (Francois-Michel Lang) writes:
> An AWK question for the resident wizards:
> Is there any way to do pattern-matching on an AWK variable?
You need nawk (the awk shipped with 5.3.2). You can say:
BEGIN { junk = "hi" }
$1 ~ junk { print "wow!" }
and it does what you expect (and want)
--
Phil Hughes, SSC, Inc. P.O. Box 55549, Seattle, WA 98155 (206)FOR-UNIX
uw-beaver!tikal!ssc!fyl or uunet!pilchuck!ssc!fyl or attmail!ssc!fyl
More information about the Comp.unix.questions
mailing list