trap
在接收到事件时执行命令。 可用于对用户中断或其他操作执行清理。 更多信息:https://manned.org/trap.1posix.
trap 'echo "捕获到信号 {{SIGHUP}}"' {{HUP}}
trap - {{HUP}} {{INT}}