IIRC disown is a shell built-in command, so its use is a bit limited. Not sure if & is also a built-in, but I found disown to not work in some situations. Besides, it’s shorter.
After looking into it a bit more, its at least a builtin for bash but is otherwise not POSIX. I guess nohup ... & would be the POSIX compliant equivalent, though still not a builtin.
Its my understanding that & backgrounds, not necessarily detaches, a process – if the parent process closes, I think the background tasks would still be wait()ed on, if only using &.
Shouldn’t you end with
& disownto fully detach?IIRC
disownis a shell built-in command, so its use is a bit limited. Not sure if&is also a built-in, but I founddisownto not work in some situations. Besides, it’s shorter.After looking into it a bit more, its at least a builtin for
bashbut is otherwise not POSIX. I guessnohup ... &would be the POSIX compliant equivalent, though still not a builtin.Its my understanding that
&backgrounds, not necessarily detaches, a process – if the parent process closes, I think the background tasks would still bewait()ed on, if only using&.