diff options
Diffstat (limited to 'scripts/install/install-functions')
-rwxr-xr-x | scripts/install/install-functions | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/install/install-functions b/scripts/install/install-functions index ff4d6f48..ffaea22d 100755 --- a/scripts/install/install-functions +++ b/scripts/install/install-functions @@ -83,18 +83,22 @@ becho () echo -e "$*" } +tolower () { + echo "$*" | tr '[:upper:]' '[:lower:]' +} + # Validates a user response. Returns the response if valid. # Returns the default is the user just hits enter. # Returns nothing if not valid. Default parameter is $1. # Options are in $2. If options are defined return must be a member # of the enum. get_response () { - ldefault=$(echo "$1" | tr [:upper:] [:lower:]) - loptions=$(echo "$2" | tr [:upper:] [:lower:]) + local ldefault=$(tolower "$1") + local loptions=$(tolower "$2") # get the response from the user read myresponse - myresponse=$(echo "$myresponse" | tr [:upper:] [:lower:]) + myresponse=$(tolower "$myresponse") # Check to see if the user accepts the default if [ -z "$myresponse" ]; then |