trap在shell脚本中捕捉信号的方法.

来源:互联网 发布:vue.js include html 编辑:程序博客网 时间:2024/04/28 20:29

 trap在shell脚本中捕捉信号的方法. 
 
trap "endit" SIGINT SIGTERM EXIT
trap "report" SIGHUP
 
endit, report 为脚本中的函数

原创粉丝点击