Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!gatech!emory!arnold From: arnold@mathcs.emory.edu (Arnold D. Robbins {EUCC}) Newsgroups: comp.unix.wizards Subject: Re: awk & variables Keywords: awk variables Message-ID: <4102@emory.mathcs.emory.edu> Date: 2 Jun 89 18:56:11 GMT References: <23206@dhw68k.cts.com> <10980@yendor.phx.mcd.mot.com> Reply-To: arnold@emory.UUCP (Arnold D. Robbins {EUCC}) Organization: Emory University Lines: 22 In article <23206@dhw68k.cts.com> jaff@dhw68k.cts.com (Mark Jaffe) writes: >Awk seems to be lacking something, but maybe it's really there. I want to >match a pattern that I don't know until I execute the script, so I want to >pass in a pattern to match in a variable. [...] In nawk (available for big bucks in S5R3.1, or for little bucks from the toolchest), and in GNU Awk (available via anonymous ftp from prep.ai.mit.edu and anonymous uucp from ohio-state for free) regular expression matching can now be dyamnic. The right hand operand of ~ and !~ is treated as a string containing a regular expression. Thus, you can do stuff like $1 ~ $2 { ..... } if you care to. Check out the book by Aho, Kernighan, and Weinberger, or the GNU Awk manual (co-authored by yours truly). Enjoy, -- Arnold Robbins -- Emory University Computing Center | Unix is a Registered DOMAIN: arnold@unix.cc.emory.edu | Bell of AT&T Trademark UUCP: gatech!emoryu1!arnold PHONE: +1 404 727-7636 | Laboratories. BITNET: arnold@emoryu1 FAX: +1 404 727-2599 | -- Donn Seeley