|
|
|
@ -11,7 +11,7 @@ else
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
# Handle Ctrl-C |
|
|
|
|
trap "printf '\n'; kill -s SIGINT $$" 2 |
|
|
|
|
trap "printf '\n'; exit 2" 2 |
|
|
|
|
|
|
|
|
|
# Use stty to make read command work for single character input |
|
|
|
|
old_stty_cfg=$(stty -g) |
|
|
|
@ -26,7 +26,7 @@ if [ -z "$answer" ]; then
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
# Print the answer and return appropriate exit code |
|
|
|
|
printf "%s\n" "$(echo $answer | tr a-z A-Z" >&2 |
|
|
|
|
printf "%s\n" "$(echo $answer | tr a-z A-Z)" >&2 |
|
|
|
|
sleep 0.01 # Without this, answer gets overwritten by next echo |
|
|
|
|
if [ "$answer" = "Y" -o "$answer" = "y" ]; then |
|
|
|
|
exit 0 |
|
|
|
|