2
|
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 |
# S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT
|
|
7 |
# 64.0 64.0 0.0 64.0 1 31 32.0 2048.0 41.4 1 0.031
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
BEGIN {
|
|
12 |
headerlines=0; datalines=0; totallines=0
|
|
13 |
}
|
|
14 |
|
|
15 |
/^ S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT $/ {
|
|
16 |
|
|
17 |
headerlines++;
|
|
18 |
}
|
|
19 |
|
|
20 |
/^[ ]*[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]+$/ {
|
|
21 |
datalines++;
|
|
22 |
}
|
|
23 |
|
|
24 |
{ totallines++; print $0 }
|
|
25 |
|
|
26 |
END {
|
|
27 |
if ((headerlines == 1) && (datalines == 1) && (totallines == 2)) {
|
|
28 |
exit 0
|
|
29 |
}
|
|
30 |
else {
|
|
31 |
exit 1
|
|
32 |
}
|
|
33 |
}
|