The format of the trap command is.
trap命令的格式为。
To catch a signal that is sent to your process, use the built-in trap command.
要捕捉发送到您的进程的信号,请使用内置的trap命令。
The first is the return status from a command, and the second is the trap command within your shell.
第一个是命令的返回状态,第二个是外壳中的trap命令。
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命令)。
应用推荐