awk & variables

Mark Jaffe jaff at dhw68k.cts.com
Fri May 26 02:38:44 AEST 1989


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 at dhw68k
Orange, CA	
(714) 744-1030



More information about the Comp.unix.wizards mailing list