I'm hoping someone may be able to help me. I am trying to get a script to run that is using awk. Below is the output:awk: syntax error near line 2awk: bailing out near line 2The error is happening in the first section after awk is called:BEGIN   {                                                                                  file = substr(ARGV[1], index(ARGV[1], =)+1)                                  file = file / substr(ARGV[2], index(ARGV[1], =)+1) .hlp                  while(getline prev[++j] < file > 0) {}        }   Here is the entire script:#!/bin/bash                                                                    # load envronment variables#. /opt/gim2usr/scripts/ScriptEnv.shw | sed -n '1p'                                                     echo                                                                           onstat -u|awk '                                                                BEGIN   {                                                                                  file = substr(ARGV[1], index(ARGV[1], =)+1)                                  file = file / substr(ARGV[2], index(ARGV[1], =)+1) .hlp                  while(getline prev[++j] < file > 0) {}        }                                                                      NR==2   {printf(%s\n, substr($0, 1, (i = index($0, days)) > 0 ? i+3 : 80))}NR==3   {for(i = 0; i < 80; i++) printf(%c, =)}                            NR==5   {printf(%s\n, $0)}                                                           {                                                                                  if (NR > 5 && NF > 9)                                                          {                                                                                  line[++y] = $1   $3   $9   $10                                             for(i = 1; i <= j; i++)                                                            if(line[y] == prev[i])                                                             break                                                                      else if(i == j)                                                                     print $0                                                               else                                                                           continue                                                       }                                                                          }                                                                      END     {                                                                                  for(i = 1; i <= y; i++)                                                            print line[i] > file                                                       print        }' v=$HOME f='basename $0'          
Help needed with awk Syntax error
awk;error handling;syntax