summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-06-01 21:52:58 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-06-01 21:52:58 +0200
commit762361539dc0b0c3bd0f15500b865752eac5a0e0 (patch)
tree88956151d4c9dcc2f112ae55e7990ed234dc0be6 /bin
parent90202ba79e338d142b0c4f951ff34bdfb65ede5c (diff)
fixed confirm_yes
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pkg12
1 files changed, 8 insertions, 4 deletions
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
}