From d2954894e7a7a0301d2c5e0508f41570889a8d98 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Wed, 21 Jan 2015 11:27:22 -0700 Subject: [PATCH] Add a trap for Ctrl+C --- bashbrew.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bashbrew.sh b/bashbrew.sh index 856d2b8..75d4028 100755 --- a/bashbrew.sh +++ b/bashbrew.sh @@ -1,6 +1,9 @@ #!/bin/bash set -e +# make sure we can GTFO +trap 'echo >&2 Ctrl+C captured, exiting; exit 1' SIGINT + # so we can have fancy stuff like !(pattern) shopt -s extglob