in reply to undefined question
You're not totally off. You're looking right at it. If the process doesn't exist, you'll get nothing on standard output. Here's why.
You might have better luck with something likewhile ( my $proc = <PROCS> ) { # if the grep filters out everything, this is a # zero-trip loop. }
Note also that you could do both of the greps in Perl, rather than launching additional external processes.my $found_one = 0; while ( my $proc = <PROCS> ) { ... $found_one = 1; } if ( $found_one ) { print "looks okay here\n"; } else { print "couldn't find $process\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: undefined question
by Anonymous Monk on Jun 09, 2003 at 04:53 UTC | |
by dws (Chancellor) on Jun 09, 2003 at 04:58 UTC | |
by Anonymous Monk on Jun 09, 2003 at 06:39 UTC |