I'm starting the same process multiple times and using the process ID to differentiate between them for future control. How would I go about getting back the process ID for the process I just started? Is it possible to append some sort of command to the command used to start the process?
If you are using a Bash script, here's what you can do:
This is just an example running gedit (text editor), saving its PID (Process ID) and killing it after 5 seconds using its PID and signal 15 (TERM).