The two examples I have are:echo hi &And:(echo hi &)The first will give me the process id as a return result (e.g. [1] 5627), where adding precedence operators removes this. What is occurring to cause this ? Also, is there a way to add precedence yet still have background tasks report their process id ?
What effect does precedence have on background task execution?
bash;background process
This is a question about job control. Please read the corresponding section is man bash.In a shell parenthesis are more than precedence operators. They fire up a new (sub-)shell.You usually type in an interactive shell with job control enabled. Putting a command in parenthesis runs this command in a subshell without job control.Try:sleep 10&jobs(sleep 10&)jobsThe first sleep is listed by jobs, as it is started from a job control enabled shell. The second one is not, because it was started by the subshell.