how to pass variables surrounded in double quotes to awk?

Hi,
I'm making progress on this but hung up on one last detail. I'd like to use AWK to pass the system date and time(among other things) to the first line of a file.

Here's what I have:

BEGIN {TOTALPP = 0;FREEPP=0;USEDPP=0;print "LPAR NAME:",lpar,"DATE:",tdate }

I call AWK with the following:
./diskchartstart_results | awk -v lpar=$NODE tdate=`date` -f testawk4 | more

My results:
awk: Cannot find or open file Mar.

The source line number is 1.
./diskchartstart_results: Broken pipe

Where our date format is:

Fri Mar 24 12:54:02 CST 2006

I then tried to pass tdate to awk as a variable itself:
./diskchartstart_results | awk -v lpar=$NODE tdate=$tdat -f testawk4 | more

Where tdat=`date`, then exported it.

My results:
syntax error The source line is 1.
The error context is
>>> tdate="Fri <<<
awk: Quitting
The source line is 1.
./diskchartstart_results: Broken pipe

So, then I figured I needed to pass tdat with double quotes around it:
tdat=\"`date`\"
root@test:/home/ash934 > echo $tdat
"Fri Mar 24 13:42:11 CST 2006"

but I end up with the same error from AWK. I have the feeling I'm missing something pretty simple. Any ideas on a clean way to get that done?

I beieve that your syntax problem is that, for each variable passed to awk, you need to provide "-v"

Try this:

./diskchartstart_results | awk -v lpar=$NODE -v tdate=`date` -f testawk4 | more

I tried your sugestion and oddly enough, it returns the same error except now it chokes on 24

Fri Mar 24 12:54:02 CST 2006

results:
awk: Cannot find or open file 24.

The source line number is 1.
./diskchartstart_results: Broken pipe

Any other ideas?

I tried it as follows and it works for me:

print "aaaaa" | nawk -v lpar=$(hostname) -v tdate="`date`" -f testawk4.awk

I added double quotes around the date and I used nawk because my awk doesn't permit variables.

YES! This works!!! I tired so many combinations, I forgot to go back and use double quotes after your sugestion of using -v for each parameter.

Thank you, have a GOOD Weekend, tmarikle!