Nov 21, 2002 #1 gem65 Programmer Aug 27, 2002 3 US I am trying to find out if a process is active wanting to return a value 1 or 0 ( true or false). (like ps -ef|grep command)
I am trying to find out if a process is active wanting to return a value 1 or 0 ( true or false). (like ps -ef|grep command)
Nov 21, 2002 #2 MikeLacey MIS Nov 9, 1998 13,212 GB something like this might help sub process_is_active($){ my $process_name = shift; open(PS,'ps -ef|'; while(<PS>){ next unless /$process_name/o; return 1; } return 0; } Mike "Experience is the comb that Nature gives us, after we are bald." Is that a haiku? I never could get the hang of writing those things. Upvote 0 Downvote
something like this might help sub process_is_active($){ my $process_name = shift; open(PS,'ps -ef|'; while(<PS>){ next unless /$process_name/o; return 1; } return 0; } Mike "Experience is the comb that Nature gives us, after we are bald." Is that a haiku? I never could get the hang of writing those things.