Skip to content

Instantly share code, notes, and snippets.

View Metal-Milonga's full-sized avatar
🎸
rockin

Dave Metal-Milonga

🎸
rockin
View GitHub Profile
@Metal-Milonga
Metal-Milonga / sigintTest.sh
Created March 6, 2020 19:25
BASH script to show how to trap and assign a different action to SIGINT (Ctrl-C)
#!/bin/bash
HANDLER() {
printf "\tReceived Ctrl-C\n"
MYSTOP=true
}
trap HANDLER SIGINT
# or
# trap HANDLER int
# trap HANDLER 2