diff --git a/Functions/Confirmation.bash b/Functions/Confirmation.bash index 14b5a87..dcf458b 100755 --- a/Functions/Confirmation.bash +++ b/Functions/Confirmation.bash @@ -2,6 +2,7 @@ confirmation() { # Receive confirmation from user as y, Y, n, or N + # returns 0 when answer is yes and 1 when answer is no # # Arguments: # message @@ -22,10 +23,16 @@ confirmation() { local choice while true; do - read -p "${message}" -n 1 -r choice + read -p "${message} " -n 1 -r choice case "$choice" in - y | Y) return 1 ;; - n | N) return 0 ;; + y | Y) + echo "" + return 0 + ;; + n | N) + echo "" + return 1 + ;; *) echo -e "\nInput must be either y, Y, n, or N" ;; esac done