From 2b5261d8927e47c876070555864f5d4ea20ede60 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Feb 24 2011 04:56:25 +0000 Subject: Update cli_printMessage.sh: - Some options were printing to standard output (the things I was probabl missing?), so make them print to standard error. I don't reuse cli_printMessage for these options for a matter of convenience. --- diff --git a/Scripts/Bash/Functions/cli_printMessage.sh b/Scripts/Bash/Functions/cli_printMessage.sh index bc03d8b..05db63a 100755 --- a/Scripts/Bash/Functions/cli_printMessage.sh +++ b/Scripts/Bash/Functions/cli_printMessage.sh @@ -96,7 +96,7 @@ function cli_printMessage { 'AsErrorLine' ) # This option is used to print error messsages. - cli_printMessage "${CLINAME}: ${MESSAGE}" + echo "${CLINAME}: ${MESSAGE}" > /dev/stderr ;; 'AsToKnowMoreLine' ) @@ -127,7 +127,7 @@ function cli_printMessage { cli_printMessage "$MESSAGE [${Y}/${N}]: " 'AsNoTrailingNewLine' # Wait for user's answer to be entered. - cli_printMessage "FLAG_ANSWER" 'AsReadLine' + read FLAG_ANSWER fi @@ -140,14 +140,6 @@ function cli_printMessage { fi ;; - 'AsReadLine' ) - if [[ $FLAG_QUIET == 'false' ]];then - # Use variable indirect expantion to redefine the - # value of the variable of name passed as message. - read ${!MESSAGE} - fi - ;; - 'AsSeparatorLine' ) if [[ "$FLAG_QUIET" == 'false' ]];then @@ -157,12 +149,12 @@ function cli_printMessage { # Draw separator. until [[ $MAX -eq 0 ]];do - printf "${MESSAGE}" + printf "${MESSAGE}" > /dev/stderr MAX=$(($MAX - 1)) done # Output newline to end separator. - echo "" + echo "" > /dev/stderr fi ;;