Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!att!linac!uwm.edu!cs.utexas.edu!convex!news From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.unix.shell Subject: Re: Awk question Message-ID: <1991Jan20.232154.29651@convex.com> Date: 20 Jan 91 23:21:54 GMT References: <3094@wyse.wyse.com> <1991Jan20.062150.24582@convex.com> <681@silence.princeton.nj.us> Sender: news@convex.com (news access account) Reply-To: tchrist@convex.COM (Tom Christiansen) Distribution: usa Organization: CONVEX Software Development, Richardson, TX Lines: 24 Nntp-Posting-Host: pixel.convex.com From the keyboard of jay@silence.princeton.nj.us (Jay Plett): :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? Hmm, now that you mention it, there's no way for awk to distinguish if (myarray[i] ~ /foo/) is the literal or the variable foo. I guess that's the price you pay for not having variable markers as you do in the shell or perl. Certainly in perl there's a big difference between if ($myarray[$i] =~ /foo/) # can't use ~ -- that's bitwise negation, per C and if ($myarray[$i] =~ /$foo/) I shall say no more. :-) --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 )