diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-06-01 21:52:58 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-06-01 21:52:58 +0200 |
commit | 762361539dc0b0c3bd0f15500b865752eac5a0e0 (patch) | |
tree | 88956151d4c9dcc2f112ae55e7990ed234dc0be6 /bin | |
parent | 90202ba79e338d142b0c4f951ff34bdfb65ede5c (diff) |
fixed confirm_yes
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/pkg | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -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 } |