| Author |
howto list running processes with Perl?
|
|
|
| please help.
i need to list running processes with Perl, any suggestions?
many thanx
clint
| |
|
| On Tue, 19 Apr 2005 16:17:52 +0000, clint wrote:
> please help.
> i need to list running processes with Perl, any suggestions?
> many thanx
> clint
sorry i mean howto count them!
thanx
clint
| |
| Rene Schickbauer 2005-04-20, 3:56 am |
| clint wrote:
> On Tue, 19 Apr 2005 16:17:52 +0000, clint wrote:
>
>
> sorry i mean howto count them!
> thanx
> clint
A rude approach would be to use backticks:
my @proc = `ps -ax`;
my $cnt = $#proc;
print "Running processes: $cnt\n";
But while where already spawning a process, why not spawn 2 and save a line
of code:
my $cnt = `ps -ax | wc -l` + 0;
print "Running processes: $cnt\n";
LLAP & LG
Rene
| |
| George Bouras 2005-04-20, 3:56 pm |
| For windows you can use the Win32_Process of wmi , or for faster execution
use the Win::API module to call the psapi.dll
| |
| Eric Teuber 2005-04-21, 8:55 pm |
| Rene Schickbauer wrote:
> clint wrote:
>
>
>
>
> A rude approach would be to use backticks:
>
> my @proc = `ps -ax`;
> my $cnt = $#proc;
> print "Running processes: $cnt\n";
>
> But while where already spawning a process, why not spawn 2 and save a line
> of code:
>
> my $cnt = `ps -ax | wc -l` + 0;
> print "Running processes: $cnt\n";
>
> LLAP & LG
> Rene
why not just
print `ps -ef | wc -l`;
Eric
| |
|
| clint <clint@freemail.hu> writes:
> please help.
> i need to list running processes with Perl, any suggestions?
> many thanx
> clint
On what platform - windows, mac, linux?
Tim
--
Tim Cross
The e-mail address on this message is FALSE (obviously!). My real e-mail is
to a company in Australia called rapttech and my login is tcross - if you
really need to send mail, you should be able to work it out!
|
|
|
|