Handling Signals in bash
Jump to navigation
Jump to search
External
Internal
Overview
The signals are caught with the trap built-in.
trap '<executable code or function name>' <signal>
function sigint() { echo "signal INT received" exit 0 }
trap 'sigint' INT