in reply to Re^3: how many instances are running ?
in thread how many instances are running ?
Which actually seems to work quite good :)#! /usr/bin/perl -lw use strict; use Shell qw(ps); my $sh = Shell->new; my @pids = grep ( $_ =~ /t\.pl/, $sh->ps('aux')); print "list of running instances:\n@pids\n" ; for( @pids ) { exit if ( $_ && /t\.pl\s.*\-a/ ) ; } print "no other instance running\n" ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: how many instances are running ?
by bart (Canon) on Mar 06, 2007 at 11:56 UTC | |
|
Re^5: how many instances are running ?
by davorg (Chancellor) on Mar 06, 2007 at 11:54 UTC |