Jun 14, 2006 #1 ranjit Technical User Apr 14, 2000 131 GB Hi, Using the notation: nawk -v VAL=$REGEXP awk.script datafile can I search the contents of the datafile for the VAL variable. If so, what is the syntax? $0 ~/VAL/ {print $0} Surely the above is searching for the string "VAL" ???
Hi, Using the notation: nawk -v VAL=$REGEXP awk.script datafile can I search the contents of the datafile for the VAL variable. If so, what is the syntax? $0 ~/VAL/ {print $0} Surely the above is searching for the string "VAL" ???
Jun 14, 2006 #2 feherke Programmer Aug 5, 2002 9,540 RO Hi Code: gawk -v VAL=$REGEXP '$0~VAL' datafile Should work with [tt]nawk[/tt] too. Feherke. http://rootshell.be/~feherke/ Upvote 0 Downvote
Hi Code: gawk -v VAL=$REGEXP '$0~VAL' datafile Should work with [tt]nawk[/tt] too. Feherke. http://rootshell.be/~feherke/
Jun 14, 2006 Thread starter #3 ranjit Technical User Apr 14, 2000 131 GB Thank you Feherke Upvote 0 Downvote