Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!uw-june!uw-entropy!dataio!pilchuck!ssc!fyl From: fyl@ssc.UUCP (Phil Hughes) Newsgroups: comp.unix.questions Subject: Re: variables in awk Summary: you need nawk Keywords: awk Message-ID: <1914@ssc.UUCP> Date: 28 Apr 89 21:54:10 GMT References: <10029@burdvax.PRC.Unisys.COM> Organization: SSC, Inc., Seattle, WA Lines: 13 In article <10029@burdvax.PRC.Unisys.COM>, lang@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