1 #
   2 # matching the following output specified as a pattern that verifies
   3 # that the numerical values conform to a specific pattern, rather than
   4 # specific values.
   5 #
   6 #  NGCMN      NGCMX       NGC      S0CMX     S0C     S1CMX     S1C       ECMX        EC      YGC   FGC   CGC 
   7 #    2176.0     7232.0     2176.0    192.0     64.0    192.0     64.0     6848.0     2048.0     1     0    0
   8 
   9 
  10 
  11 BEGIN   {
  12             headerlines=0; datalines=0; totallines=0
  13         }
  14 
  15 /^  NGCMN      NGCMX       NGC      S0CMX     S0C     S1CMX     S1C       ECMX        EC      YGC   FGC   CGC $/        {
  16             headerlines++;
  17         }
  18 
  19 /^[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+[ ]*[0-9]+$/    {
  20             datalines++;
  21         }
  22 
  23         { totallines++; print $0 }
  24 
  25 END     {
  26             if ((headerlines == 1) && (datalines == 1)) {
  27                 exit 0
  28             }
  29             else {
  30                 exit 1
  31             }
  32         }
--- EOF ---