Need help with script option

Hi,

So my script reads $1 on the command line.
example:

SCRIPT_NAME 1111

In my script I use a nawk statement to grab $1 but I also need it to read $1 from the variable (1111 from command line in the example)

nawk -F, '($1~1111)' *.$date.*

What can I do so that this nawk statement takes $1 from it's results and uses the variable given at the command line?

Thank you for any responses.

use -v switch.
something like:

awk -F, -v var=$1 '($1~var)' *.$date.*

That worked like a charm! thank you!!![COLOR="\#738fbf"]