Awk question

Tom Christiansen tchrist at convex.COM
Tue Jan 22 06:36:28 AEST 1991


>From the keyboard of dag at fciva.UUCP (Daniel A. Graifer):
:In article <1991Jan20.232154.29651 at convex.com> I said:
:>: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. 
:
:$ nawk 'BEGIN{

Ah, a _nawk solution.  Shoulda known. :-)  I had perl two years
before I got gawk, and the awk on my system is still the old one.

thanks,

-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