builtin
disown
Remove a job from the active jobs table, or with -h mark it against Bash forwarding SIGHUP when Bash receives SIGHUP. Not a service supervisor; the example tests marking, not actual hangup delivery.
Formal Syntax & Structure
bash syntaxbash
disown [-h] [id ...]Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| id | PID or jobspec | Known shell job. |
Return Value
exit status
Remove a job from the active jobs table, or with -h mark it against Bash forwarding SIGHUP when Bash receives SIGHUP. Not a service supervisor; the example tests marking, not actual hangup delivery.
Working Example
Example Snippetbash
sleep 0.2 &pid=$!disown -h "$pid" || exit 1wait "$pid" || exit 1printf 'marked and collected\n'