Suspends the execution of the shell.
suspend [-f]
Suspend the execution of the shell until the SIGCONT
signal is received.
Cannot be used with the login shell
unless the -f
option is used.
-f performs a suspend operation on the login shell.
Returns successful unless job control is not enabled or an error occurs.
# Open a terminal and first obtain the PID.
echo $$
# Execute the suspend command
suspend
# Open another terminal and send the SIGCONT command
kill -s SIGCONT PID
# At this point, the previous terminal ends the suspended state and can interact normally.
bash
include bg fg kill wait disown suspend
.set
option monitor
is turned on; to view the job control status: enter set -o
to view the monitor
line; execute set -o monitor
or set -m
to turn it on this option.help
command.