Possible Duplicate:
Parsing errors in awk blocks
I am getting a parsing error while executing an awk script. I am not sure abt this. Here is the script
`awk 'BEGIN
{
INPUTFILE ='XXX'; iterator =0;
requestIterator =0;
storageFlag =T;
printFlag =F;
currentIteration =F;
recordCount =1;
while (getline < "'"$INPUTFILE"'")
{
requestArray[requestIterator]++;
requestIterator++;
}
}
if ($1 ~ /RequestId/)
{
FS = "=";
if($2 in requestArray)
{
storage[iterator] =$0;
printFlag =T;
next
}
else
{
storageFlag =F;
next
}
}
else
{
if((storageFlag =='T' && $0 != "EOE"))
{
storage[iterator]=$0; iterator++;
}
else {if(storageFlag == 'F')
{
next
}
else
{
if(printFlag == 'T')
{
for(details in storage)
{
print storage[details] >> FILE1;
delete storage[details];
}
printFlag =F;
storageFlag =T;
next
}
}
}
}’ FILE2`
Error
zsh: parse error near `}’
Could you ppl please let me know whats wrong in this script
Your parens are mismatched (13 x
{vs 12 x}), so you are missing a final closing}at the end of your script.I.e.,
should be