Index: bin/ext/cli.sh =================================================================== --- bin/ext/cli.sh (revision 832103) +++ bin/ext/cli.sh (working copy) @@ -16,10 +16,14 @@ version=$($HADOOP version | awk '{if (NR == 1) {print $2;}}'); - if [[ $version =~ ^([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+).*$ ]]; then + # Save the regex to a var to workaround quoting incompatabilities + # between Bash 3.1 and 3.2 + version_re="^([[:digit:]]+)\.([[:digit:]]+)(\.([[:digit:]]+))?.*$" + + if [[ "$version" =~ $version_re ]]; then major_ver=${BASH_REMATCH[1]} minor_ver=${BASH_REMATCH[2]} - patch_ver=${BASH_REMATCH[3]} + patch_ver=${BASH_REMATCH[4]} else echo "Unable to determine Hadoop version information." echo "'hadoop version' returned:"