From 0dfc334b98828facb30e91c7429eb38fb53ed83a Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sat, 6 Nov 2010 01:14:15 +0600 Subject: Fixed yesno error messages when run with no "-y" argument and with empty prompt. --- scripts/yesno | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/yesno b/scripts/yesno index 9955286..3e10e09 100755 --- a/scripts/yesno +++ b/scripts/yesno @@ -2,7 +2,7 @@ # Usage: yesno prompt... default= -if [ $1 == "-y" ] +if [ "$1" = "-y" ] then default='y'; shift fi @@ -14,7 +14,7 @@ fi while true do read -p "$prompt" || exit 1 - if [ -z "$REPLY" -a ! -z $default ] + if [ -z "$REPLY" -a ! -z "$default" ] then REPLY=$default fi case "$REPLY" in -- cgit v1.2.3