get the pid of a a specific instance of the same program
hello,
i am using wget to capture mp3 streams. how can i get the pid of the wget i just called so i can record that pid in a db or file and eventually kill that wget from another script. if i have several processes running/streams recording calling pidof wget will return the pids of all the wgets and not a specific one. or can i get the pid of a wget by using the parameters that initially called the wget so i don't have to pass ids between scripts. i hope this makes sense steve |
"$!" will hold the PID of the process previously executed, else 'pgrep' allows selection with globbing using "-f", so 'pgrep -d ' ' -f 'wget.*.*010101.mp3' should get all instances of the wget command where also one of the arguments also has "010101.mp3".
|
wicked, thanks!
|
All times are GMT -5. The time now is 04:08 PM. |