> You have to start the job with job control enabled if you want the > background process to be its own process group leader, and at that point > the shell started to run the group command will not have job control > enabled and will run all processes in the same process group (its own),' > so you could in theory use $!. > > If you start it from a shell with job control enabled, the bash running the > -c command will be in its own process group and be the process group > leader, and not have job control enabled.
> See above about job control shells. The -c command shell is not > interactive, and will not have job control enabled by default, so all > processes in that command will be in the same process group, so if you can > figure out what it is, you should be fine. If you don't start that from a > shell with job control enabled, the process group will be difficult to > find, but $$ is your best bet and should work if you're starting it from > a job control shell. > Yes, -m is exactly what I'm looking for. I should have read more about job control and processes / process groups before posting the first mail. Thanks for bearing with my ignorance -- Oğuz