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 # S0 S1 E O M YGC YGCT FGC FGCT GCT 7 # 0.00 100.00 68.87 1.24 27.75 1 0.044 0 0.000 0.044 8 # 0.00 100.00 68.87 1.24 27.84 1 0.044 0 0.000 0.044 9 # 0.00 100.00 68.87 1.24 27.84 1 0.044 0 0.000 0.044 10 # 0.00 100.00 70.89 1.24 27.84 1 0.044 0 0.000 0.044 11 # 0.00 100.00 70.89 1.24 27.84 1 0.044 0 0.000 0.044 12 13 BEGIN { 14 headerlines=0; datalines=0; totallines=0 15 } 16 17 /^ S0 S1 E O M YGC YGCT FGC FGCT GCT $/ { 18 headerlines++; 19 } 20 21 /^[ ]*[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]+$/ { 22 datalines++; 23 } 24 25 { totallines++; print $0 } 26 27 END { 28 if ((headerlines == 1) && (datalines == 5) && (totallines == 6)) { 29 exit 0 30 } 31 else { 32 exit 1 33 } 34 }