Hi.
Does anyone know how to find out the process ID of a python script?
I need to check if jack_mixer is running, so I need something that returns the process ID of jack_mixer, which is a python script.
Thanks in advance,
RSH
How to get Process ID of a python script?
Re: How to get Process ID of a python script?
Can't test, but I'd say this could do:ITSMERSH wrote:Hi.
Does anyone know how to find out the process ID of a python script?
I need to check if jack_mixer is running, so I need something that returns the process ID of jack_mixer, which is a python script.
Thanks in advance,
RSH
Code: Select all
pidjack_mixer=$(ps -eo pid,cmd | grep -v grep | grep "jack_mixer" | awk '{ print $1 }')
echo $pidjack_mixer
Re: How to get Process ID of a python script?
This seems to work very well.fredx181 wrote:Can't test, but I'd say this could do:ITSMERSH wrote:Hi.
Does anyone know how to find out the process ID of a python script?
I need to check if jack_mixer is running, so I need something that returns the process ID of jack_mixer, which is a python script.
Thanks in advance,
RSHFredCode: Select all
pidjack_mixer=$(ps -eo pid,cmd | grep -v grep | grep "jack_mixer" | awk '{ print $1 }') echo $pidjack_mixer
Thanks!