Skip to content

Instantly share code, notes, and snippets.

@josepsmartinez
Created February 8, 2021 14:41
Show Gist options
  • Save josepsmartinez/93ce359d5118b1713a5bff5760e63e4a to your computer and use it in GitHub Desktop.
Save josepsmartinez/93ce359d5118b1713a5bff5760e63e4a to your computer and use it in GitHub Desktop.
Trapping INT signal on bash script
#!/bin/bash
trap 'echo "Exiting due to keyboard interrupt."; exit' INT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment