Discussion in 'Programming/Scripts' started by andipurwito, Sep 12, 2007.
Can i run a program with my own pid from command prompt?
Ex: # ./myprogram [pid]
what do you mean with "your own pid"? Each process running gets a process id (PID) from the system. If the process ends, you won't see it anymore (e.g. in ps) and logically there is no PID anymore.
Or what do you plan to do?
I mean: how to run program with my own PID?
Example: ./myprogram 12345
12345 is my own PID. Is there any option from Linux kernel to obtain like this?
The PIDs are assigned automatically, you can't do that yourself.
If you'd like to find out the PID of a certain process, take a look at
Forgive me if this question seem stupid and wrong in how to explain.
I just want to run the same program but with many of profile in the same time. And then i will take its pid later to identify each running profile.
# myprogram profile1 &
# myprogram profile2 &
# myprogram profile3 &
How should i make this possible?
then just do sth like
And split the string (sry i am no bash expert for splitting strings ) and grep the pid for that progammcall.
Maybe you have to add an
grep -v "grep \"yourpgroammcall\""
so that the grep call does not exist in the output.
Separate names with a comma.