jcmd_Output1.awk revision 5776
0N/A#
0N/ABEGIN {
0N/A totallines=0; matched=0; current=0
0N/A }
0N/A
0N/A# match on a main class name followed by arbitrary arguments
0N/A/^[0-9]+ [a-z|A-Z][a-z|A-Z|0-9|\.]*($| .*$)/ {
0N/A current=1;
0N/A }
0N/A
0N/A# or match on a path name to a jar file followed by arbitraty arguments
0N/A# - note, jar files ending with ".jar" is only a convention, not a requirement.
0N/A#Theoretically, any valid file name could occur here.
0N/A/^[0-9]+ .*\.jar($| .*$)/ {
0N/A current=1;
0N/A}
0N/A
0N/A# or match on the condition that the class name is not available
0N/A/^[0-9]+ -- process information unavailable$/ {
0N/A current=1;
0N/A }
0N/A
0N/A { totallines++; matched+=current; current=0; print $0 }
0N/A
0N/AEND {
0N/A if ((totallines > 0) && (matched == totallines)) {
0N/A exit 0
0N/A }
0N/A else {
0N/A exit 1
0N/A }
0N/A }
0N/A