builtin

suspend — suspend the current shell

Pauses the shell until SIGCONT. Normally needs job control and a non-login shell; -f overrides those safeguards. Use an owned disposable shell under a supervising parent, never force suspension in a personal terminal or unattended script. The safe example verifies refusal without job control, not actual suspension. Run in a fresh private directory with HOME set to that directory and LC_ALL=C. Expected output (one item per line): status=1.

Formal Syntax & Structure

bash syntaxbash
suspend [-f]

Parameters & Attributes

NameTypeDescription
-fflagForce suspension even when normal safeguards reject it; not used here.

Return Value

exit status

Zero on success; nonzero on failure, unless otherwise noted.

Working Example

Example Snippetbash
set +mif suspend 2>diagnostic; then exit 1; else printf 'status=%s\n' "$?"; figrep -Fq 'no job control' diagnostic || exit 1
Bash Reference