awk/input parameter

Hi,

My script takes in one input parameter($1-email id) on the command line...

The script contains something like this...

awk '$1 == 400' abc.log >def.log
mail -s subject $1 <def.log

abc.log looks something like this...

300 222 330 123 445
400 098 890 727 663

How do i make the awk to know that by $1 I am referring to the first field in the log rather than the input parameter($1) given in the command line..

var=400
awk -v v1=$var '{ if ( $1 == v1 ) { print } }' filename

Thanks Madhan...

What if the script takes in two input parameters..it becomes tricky then eh?

First parameter-$1-email
Second parameter- $2 -number(eg: 400 ,300)

awk '$1 == $2' abc.log >def.log
mail -s subject $1 <def.log

abc.log looks something like this...

300 222 330 123 445
400 098 890 727 663

just extend the variable list to the number of variables that are in question

var=400
var2=890
awk -v v1=$var -v v2=$var2 '{ if ( $1 == v1 && $3 == v2 ) { print } }' filename