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

NameTypeDescription
idPID or jobspecKnown 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'
Bash Reference