From 07c61562b4c9ba449e85508da71320f0e4fa3e09 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 22 Apr 2025 10:02:39 +0200 Subject: checkpoint --- bin/extra/confirm | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'bin/extra') diff --git a/bin/extra/confirm b/bin/extra/confirm index 630d701..7c653b9 100755 --- a/bin/extra/confirm +++ b/bin/extra/confirm @@ -1,12 +1,6 @@ #!/bin/sh - -read_char () -{ - old_stty_cfg=$(stty -g 2> /dev/null) - stty raw -echo 2> /dev/null - dd ibs=1 count=1 2> /dev/null - stty "$old_stty_cfg" 2> /dev/null -} - ->&2 printf "%s " "$1" -read_char | grep -q "[yY]" +trap 'exit' INT +old_stty_cfg=$(stty -g 2> /dev/null) +stty raw -echo 2> /dev/null +dd ibs=1 count=1 2> /dev/null +stty "$old_stty_cfg" 2> /dev/null -- cgit v1.2.3