From 762361539dc0b0c3bd0f15500b865752eac5a0e0 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 1 Jun 2008 21:52:58 +0200 Subject: fixed confirm_yes --- bin/pkg | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/pkg b/bin/pkg index 494e922..5197074 100755 --- a/bin/pkg +++ b/bin/pkg @@ -28,13 +28,17 @@ die () { } confirm_yes () { - echo -n "${info}$*${reset} [Y/n] " - read -q - [ -z "$REPLY" ] && true + echo -n "$* [Y/n] " + read -k 1 + if ([ "$REPLY" = 'y' -o "$REPLY" = 'Y' -o "$REPLY" = $'\n' ]) { + true + } else { + false + } } confirm_no () { - echo -n "${error}$*${reset} [y/N] " + echo -n "$* [y/N] " read -q } -- cgit v1.2.3