jps-l_Output1.awk 689 字节
Newer Older
D
duke 已提交
1 2 3 4 5 6 7 8 9 10
#
BEGIN	{
	    totallines=0; matched=0
	}

# match on a fully qualified class name
/^[0-9]+ [a-z|A-Z][a-z|A-Z|0-9|\.|\$|\+]*$/	{
	    matched++;
	}

11
# or match on a jar or war file name - note, jar files ending with
D
duke 已提交
12 13
# ".jar" is only a convention , not a requirement. Theoretically,
# any valid file name could occur here.
14
/^[0-9]+ .*\.(jar|war)$/	{
D
duke 已提交
15 16 17 18
	    matched++;
}

# or match on the condition that the class name is not available
19
/^[0-9]+ -- .*$/	{
D
duke 已提交
20 21 22
	    matched++;
	}

23 24 25 26 27
# or match an empty class name
/^[0-9]+ $/	{
	    matched++;
	}

D
duke 已提交
28 29 30 31 32 33 34 35 36 37
	{ totallines++; print $0 }

END	{
	    if ((totallines > 0) && (matched == totallines)) {
	        exit 0
	    }
	    else {
	        exit 1
	    }
	}