The usual reason for running it in a subshell is so that shell doesn't print a message when the background process starts and finishes.
Also, if the script ever uses the wait
command, it won't wait for background processes started in subshells (a process can only wait for its own children, not grandchildren).
This also means that the script can't get the exit status of the background process if it's started in a subshell -- you need to use wait
to get that. And the $!
variable won't be set to the PID of the background process (it's set inside the subshell, not the original shell process).
Basically, you use (command&)
if the original shell has no need to deal with the background process, it just wants to start it and forget about it.