perl 5.0 alpha 2
[p5sagit/p5-mst-13.2.git] / eg / scan / scan_ps
CommitLineData
378cc40b 1#!/usr/bin/perl -P
2
79072805 3# $RCSfile: scan_ps,v $$Revision: 4.1 $$Date: 92/08/07 17:20:40 $
378cc40b 4
5# This looks for looping processes.
6
7#if defined(mc300) || defined(mc500) || defined(mc700)
8open(Ps, '/bin/ps -el|') || die "scan_ps: can't run ps";
9
10while (<Ps>) {
11 next if /rwhod/;
12 print if index(' T', substr($_,62,1)) < 0;
13}
14#else
15open(Ps, '/bin/ps auxww|') || die "scan_ps: can't run ps";
16
17while (<Ps>) {
18 next if /dataserver/;
19 next if /nfsd/;
20 next if /update/;
21 next if /ypserv/;
22 next if /rwhod/;
23 next if /routed/;
24 next if /pagedaemon/;
25#ifdef vax
26 ($user,$pid,$cpu,$mem,$sz,$rss,$tt,$stat,$start,$time) = split;
27#else
28 ($user,$pid,$cpu,$mem,$sz,$rss,$tt,$stat,$time) = split;
29#endif
30 print if length($time) > 4;
31}
32#endif