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:" @@ -27,7 +31,7 @@ exit 6 fi - if [ $minor_ver -le 20 ]; then + if [ $minor_ver -lt 20 ]; then exec $HADOOP jar $AUX_JARS_CMD_LINE ${HIVE_LIB}/hive_cli.jar $CLASS $HIVE_OPTS "$@" else # hadoop 20 or newer - skip the aux_jars option. picked up from hiveconf