CTRL+C异常捕获
trap ‘onCtrlC’ INT
function onCtrlC () {
echo ‘Ctrl+C is captured’
echo ‘Program exit exceptionally ,You can rerun the script!’
exit 1
}
微信扫一扫
trap ‘onCtrlC’ INT
function onCtrlC () {
echo ‘Ctrl+C is captured’
echo ‘Program exit exceptionally ,You can rerun the script!’
exit 1
}
相关推荐