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