On Fri, 2008-08-01 at 04:03 -0700, John W. Krahn wrote:
> The OP was using:
> 
> ps -U oraoneload_beta  -u oraoneload_beta u | grep perl | grep -v grep
> 
> If you used the shell at all you would know that the second grep is 
> there to remove the line that the first grep generates.  You could 
> achieve the same result with:
> 
> ps -U oraoneload_beta  -u oraoneload_beta u | grep pe[r]l
> 
> Because grep pe[r]l matches perl but not pe[r]l.
> 
> Also because I used the ps switch '-o command' instead of the OP's 'u' 
> switch the pattern should probably be anchored at the beginning of the 
> string anyway:
> 
>      next unless /^perl/;

This is not the equivalent of what the OP wrote.

Of course, s/he shouldn't be using `ps` in the first place.  To montior
the processes on your computer, you should use the
pseudo-directory /proc .  But why bother.  There are many FOSS available
that can do this and they're already debugged.

If you want to deal with one specific process, you should set up an
Inter-Process Communication (See `perldoc perlipc` for details).


-- 
Just my 0.00000002 million dollars worth,
  Shawn

"Where there's duct tape, there's hope."

"Perl is the duct tape of the Internet."
        Hassan Schroeder, Sun's first webmaster


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to