#!/bin/bashexport TOP_PID=$$trap 'exit 1' TERMexit_script(){ kill -s TERM $TOP_PID}echo "before exit":|exit_scriptecho "after exit"EOF
执行结果为
before exit
本文共 211 字,大约阅读时间需要 1 分钟。
#!/bin/bashexport TOP_PID=$$trap 'exit 1' TERMexit_script(){ kill -s TERM $TOP_PID}echo "before exit":|exit_scriptecho "after exit"EOF
执行结果为
before exit
转载于:https://www.cnblogs.com/sea-stream/p/9708526.html