Hi All....
I need to pass date into awk and parse logfile based on that.... i used both awk and /usr/xpg4/bin/awk... both are throwing up error.....
So here is the stuff...
when i use /usr/xpg4/bin/awk :
DATE=`date '+%Y %b %d'`
START=00
END=23
/usr/xpg4/bin/awk -v DATE={"$DATE"} -v START=$START -v END=$END '/DATE START/,/DATE END/' logfile.log > processfile.txt
Error :
/usr/xpg4/bin/awk: inadmissible use of reserved keyword Context is:
>>> {2010 Jan 02}1023 <<<
when i use awk:
DATE=`date '+%Y %b %d'`
START=00
END=23
awk -v DATE={"$DATE"} -v START=$START -v END=$END '/DATE START/,/DATE END/' logfile.log > processfile.txt
Error:
awk: syntax error near line 1
awk: bailing out near line 1
Can anyone think of y this error is happening??? How to finally pass date into awk???