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?