Hi,

I've got this shell script:

#!/bin/sh
ps axc|awk "{if (\$5==\"$1\") print \$1}";

... which gets a PID if you feed it the process' name. Is there a way to translate this into Perl using a standard Perl distribution? I mean, without calling 'ps'; I've learned enough Perl now to be able to do that, but I'd like to see if there's a cleaner way. I don't know, maybe process names aren't something other operating systems have, so Perl doesn't have anything for them--I'm on Mac OS X.

I checked everything that was indexed in Programming Perl that looked likely, but obviously I didn't find anything.

Michael


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




Reply via email to