Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^3: custom name to the process

by Eimi Metamorphoumai (Deacon)
on Dec 04, 2007 at 22:15 UTC ( #654973=note: print w/replies, xml ) Need Help??

in reply to Re^2: custom name to the process
in thread custom name to the process

Well, you can check the value of $0 and do different things with it. But probably the best solution is to use different parameters to ps. For instance, ps -fe will give you the parameters passed to each instance, which is probably a pretty good way of distinguishing your processes.

Replies are listed 'Best First'.
Re^4: custom name to the process
by aquarium (Curate) on Dec 04, 2007 at 22:41 UTC
    As has been hinted at, some OSes specifically disable showing of parameters, as showing those can prove to be security hole....e.g. you can see which config files are used by some programs OR even see userid/password passed to a program as parameters.
    symlinks are probably the best bet, as you can't reserve PID, for reasons of OS stability/security. You could easily though print the PID from the program when it starts each time, by printing the $$ variable.
    the hardest line to type correctly is: stty erase ^H

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2020-10-19 16:29 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (205 votes). Check out past polls.