Capture a key press to trigger some action.
# Press ‘c’ to cancel, any other key to continue. read -s -n1 -p $'Press c to cancel. Any other key to continue.\n' \ keypress if [[ $keypress = c ]] then exit fi