Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Unix process number on a mac...

by Tuppence (Pilgrim)
on Mar 15, 2005 at 22:27 UTC ( #439798=note: print w/replies, xml ) Need Help??


in reply to Unix process number on a mac...

you can check the output of `ps x` to find out if the process is still running. PID is the first column of the output, extracting this in a programmatic form is 'easy' in perl and so left to the poster.

Replies are listed 'Best First'.
Re^2: Unix process number on a mac...
by brian_d_foy (Abbot) on Mar 16, 2005 at 03:27 UTC

    You don't need to extract the PID because you already have it. That's how you got the output, after all. If you wanted to do it this way (and it's not the way you should do it), you want to look if you get output besides the header line.

    --
    brian d foy <bdfoy@cpan.org>

      Yes, your kill 0, $pid is indeed a much better solution.

      The only reason to extract the PID with my solution is to check it against the PID that you have stored, which as you say isn't that great when we can just ask the system directly.

      It still would have worked tho :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://439798]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2022-01-22 19:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (63 votes). Check out past polls.

    Notices?