builtin

wait -f

With job control enabled, wait for termination instead of a state change. Local example checks normal termination, not a stopped job.

Formal Syntax & Structure

bash syntaxbash
wait -f id

Return Value

exit status

With job control enabled, wait for termination instead of a state change. Local example checks normal termination, not a stopped job.

Working Example

Example Snippetbash
set -m( exit 3 ) &pid=$!wait -f "$pid" 2>/dev/nullprintf 'status=%s\n' "$?"
Bash Reference