Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!agate!pasteur!ames!elroy!usc!orion.cf.uci.edu!uci-ics!zardoz!dhw68k!jaff From: jaff@dhw68k.cts.com (Mark Jaffe) Newsgroups: comp.unix.wizards Subject: awk & variables Keywords: awk variables Message-ID: <23206@dhw68k.cts.com> Date: 25 May 89 16:38:44 GMT Organization: Wolfskill & Dowling residence; Anaheim, CA (USA) Lines: 17 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. I can't get this to work! Here's what I'm doing, on a Sun: . . SYSVER=`awk '{print $3}' < /etc/motd` . awk ' $0 ~ $SYSVER { print substr($0, 3, length - 2) } ' < cs35if.h > cs35.if . (in a shell script) Any suggestions? Mark Jaffe Transitional Technology, Inc. | jaff@dhw68k Orange, CA (714) 744-1030