diff --git a/pythonbrew-install b/pythonbrew-install index 3dac1e8..f918d47 100755 --- a/pythonbrew-install +++ b/pythonbrew-install @@ -10,7 +10,6 @@ trim() trimmed=$1 trimmed="${trimmed#"${trimmed%%[![:space:]]*}"}" # remove leading whitespace characters trimmed="${trimmed%"${trimmed##*[![:space:]]}"}" # remove trailing whitespace characters - echo $trimmed } @@ -48,18 +47,18 @@ if [[ ! -x $CURL ]] ; then fi for PYTHON in $PYTHONS ; do - if [[ ! -x $PYTHON ]] ; then - continue - fi + if [[ ! -x $PYTHON ]] ; then + continue + fi - PYTHON_VERSION=`$PYTHON -V 2>&1` - PYTHON_VERSION=${PYTHON_VERSION/"Python "/""} - PYTHON_VERSION_S=`echo $PYTHON_VERSION | sed -e "s/\(^[[:digit:]]\{1,\}.[[:digit:]]\{1,\}\).*/\1/"` + PYTHON_VERSION=`$PYTHON -V 2>&1` + PYTHON_VERSION=${PYTHON_VERSION/"Python "/""} + PYTHON_VERSION_S=`echo $PYTHON_VERSION | sed -e "s/\(^[[:digit:]]\{1,\}.[[:digit:]]\{1,\}\).*/\1/"` - if [[ $PYTHON_VERSION_S = "2.4" ]] || [[ $PYTHON_VERSION_S = "2.5" ]] || [[ $PYTHON_VERSION_S = "2.6" ]] || [[ $PYTHON_VERSION_S = "2.7" ]] ; then - PYTHON_FOUND='1' - break - fi + if [[ $PYTHON_VERSION_S = "2.4" ]] || [[ $PYTHON_VERSION_S = "2.5" ]] || [[ $PYTHON_VERSION_S = "2.6" ]] || [[ $PYTHON_VERSION_S = "2.7" ]] || [[ ${PYTHON_VERSION_S:0:1} = "3" ]] ; then + PYTHON_FOUND='1' + break + fi done if [[ $PYTHON_FOUND != '1' ]] ; then echo "pythonbrew required Python (2.4, 2.5, 2.6 or 2.7)."