#Bash 的 suspend 命令
suspend [OPTION]
功能
暂停当前 shell 的执行,直到收到 SIGCONT 信号时恢复。
登录 shell 和没有作业控制的 shell 无法暂停;除非使用
-f选项强制执行。
类型
Bash 内置命令。
参数
OPTION选项:-f- 强制执行
#示例
$ bash # 启动一个新的 shell 此处是外层 shell
$ suspend # 暂停 shell 的执行 此处是内层 shell
[1]+ Stopped bash
$ fg # 恢复 shell 的执行 此处是外层 shell
bash
$ # 此处是内层 shell
#推荐阅读
#手册
suspend: suspend [-f]
Suspend shell execution.
Suspend the execution of this shell until it receives a SIGCONT signal.
Unless forced, login shells and shells without job control cannot be
suspended.
Options:
-f force the suspend, even if the shell is a login shell or job
control is not enabled.
Exit Status:
Returns success unless job control is not enabled or an error occurs.