When a signal is caught, the current command being executed attempts to complete before the trap command takes over.
在捕捉到信号后,正在执行的当前命令会尝试在trap接管之前结束执行。
The first trap command causes the stopsleep function to be run whenever a SIGCHLD, SIGINT, or SIGTERM signal is received.
第一个trap命令将使stopsleep函数在接受到SIGCHLD、SIGINT或SIGTERM信号时运行。
The trap command prevents the script from being interrupted by the user (by pressing control-C during boot, for example) while the script executes.
trap命令防止用户在脚本执行时中断(例如,在引导时键入control - c)脚本。
A message displays containing the line number and command when the trap was caught; the script then exits (from the exit command on the trap command list).
在捕捉到trap后,会显示一条包含行号和命令的消息;脚本随后将退出执行(使用trap命令列表中的exit命令)。
A message displays containing the line number and command when the trap was caught; the script then exits (from the exit command on the trap command list).
在捕捉到trap后,会显示一条包含行号和命令的消息;脚本随后将退出执行(使用trap命令列表中的exit命令)。
应用推荐