in reply to (jeffa) Re: array newbie...(sigh)
in thread array newbie...(sigh)
my @arraylist = qw(netman jobman mailman batchman writer); foreach my $process (@arraylist) { `ps -ef|grep -i $process|grep -v grep|wc -l`; } chomp @arraylist; #\s+/ /g for @h; print @arraylist; #@h = ($netman= `ps -ef|grep -i netman|grep -v grep|wc -l`, # $jobman= `ps -ef|grep -i jobman|grep -v grep|wc -l`, # $mailman= `ps -ef|grep -i mailman|grep -v grep|wc -l`, # $batchman= `ps -ef|grep -i batchman|grep -v grep|wc -l`, # $writer= `ps -ef|grep -i writer|grep -v grep|wc -l` # ); #%h = ("a", "$netman", "b", "$jobman", "c", "$mailman", "d", "$batchma +n", "e", "$writer"); #@h = ("$netman","$jobman","$mailman","$batchman","$writer"); #chomp @h; #\s+/ /g for @h; #@h > ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) 3Re: array newbie...(sigh)
by jeffa (Bishop) on Mar 15, 2002 at 22:25 UTC |