title: Parsing error in awk
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/11201565/parsing-errors-in-awk-blocks">Parsing errors in awk blocks</a>  </p>
  </blockquote>
  
  
  
  <p>I am getting a parsing error while executing an awk script. I am not sure abt this. Here is the script</p>
  
  <pre><code>`awk 'BEGIN 
  { 
  INPUTFILE ='XXX'; iterator =0;
  requestIterator =0;
  storageFlag =T;
  printFlag =F;
  currentIteration =F;
  recordCount =1;
     while (getline &lt; "'"$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' &amp;&amp; $0 != "EOE"))   
         {
              storage[iterator]=$0; iterator++;
         } 
         else {if(storageFlag == 'F')
         {
              next
         } 
         else
         {
             if(printFlag == 'T')
             {
                  for(details in storage) 
             {
                  print storage[details] &gt;&gt; FILE1;
                  delete storage[details];
             } 
             printFlag =F;
             storageFlag =T;
             next
         }
   }
  </code></pre>
  
  <p>}
  }' FILE2`</p>
  
  <p><strong>Error</strong>
  zsh: parse error near `}'</p>
  
  <p>Could you ppl please let me know whats wrong in this script</p>