
HELP: Passing Unix vars to AWK
I have a sh script that calls awk and basically I have
3 vars declared outside of awk which I need to use
within awk, how do I pass them to awk?
here is part of the script
#!/bin/sh
LOGCHECK_LOG=$HOME/PROGS/logcheck.tmp
LAST_RAN_MONTH=`head -1 $LOGCHECK_LOG |awk '{print $1}'`
...
cat <file>| awk '{
if ($1 ~/<var>)
^_______this is where I want it
{
...
Quote:
}
}'
Any help immensly appreciated
Cheers
Mas'ud
--
=================================================================
Masud Ahmed Khan Unix Engineer
Crosfield Electronics Ltd.,
Three Cherry Trees Lane, Hemel Hempstead, Hertfordshire
tel: +44 (0)1442 343098 Mobile: 0973 118 665
ALL OPINIONS ARE MINE ONLY NOT THE COMPANY THAT I WORK FOR
=================================================================