Hi All,
bash-3.2$ autorep -J BOX_NAME% -l0 | grep BOX_NAME| awk -f awkScript.awk
sh: -c: line 0: unexpected EOF while looking for matching `"'
sh: -c: line 1: syntax error: unexpected end of file
BOX_NAME SU 06/21/2013 03:44:03 06/21/2013 07:46:37 0
#My awkfile
{
"date +%s -d \""$2" "$3"\"" | getline startTime;
"date +%s -d \""$4" "$5"\"" | getline endTime;
duration = (endTime - startTime)/60;
printf "\t" "%s %s %s %s %s %s %s\n",$1,$6,$2,$3,$4,$5,duration
}
when I hardcode the values in places of field variables inside date command , that works.
So basically my question is how should I use field variables like $1,$2 etc in date command in awk , I should I use quotes with them.
I tried finding on google but could not get answer .
Thanks.
Spark.