From 070e441697018e1396b07b99c846093911c49dca Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Feb 20 2011 05:34:41 +0000 Subject: Update cli_printMessage.sh: - Move positive answer verification outside FLAG_ANSWER verification in order to be sure the user's answer matches the positive answer definition. Otherwise, positive answer verification would be limited to false values of FLAG_ANSWER only. Remember, --answer option accepts an argument as value and that value can be whaterver thing the use want to enter there so verification should be enforced in order to match the value considered positive. --- diff --git a/Scripts/Bash/Functions/cli_printMessage.sh b/Scripts/Bash/Functions/cli_printMessage.sh index 94c55a2..bc03d8b 100755 --- a/Scripts/Bash/Functions/cli_printMessage.sh +++ b/Scripts/Bash/Functions/cli_printMessage.sh @@ -129,14 +129,14 @@ function cli_printMessage { # Wait for user's answer to be entered. cli_printMessage "FLAG_ANSWER" 'AsReadLine' - # Verify user's answer. Only positive answer let the - # script flow to continue. Otherwise, if something - # different from possitive answer is passed, the - # script terminates its execution immediatly. - if [[ ! ${FLAG_ANSWER} =~ "^${Y}" ]];then - exit - fi + fi + # Verify user's answer. Only positive answer let the + # script flow to continue. Otherwise, if something + # different from possitive answer is passed, the + # script terminates its execution immediatly. + if [[ ! ${FLAG_ANSWER} =~ "^${Y}" ]];then + exit fi ;;