suppress output from which command, and make grep quiet
@@ -177,14 +177,14 @@ PYTHON=
for PYTHON_EXECUTABLE in python python3 python3.6 python3.7
do
# Skip python executables that don't exist in PATH
- if ! which ${PYTHON_EXECUTABLE}; then
+ if ! which ${PYTHON_EXECUTABLE} &> /dev/null; then
continue
fi
possible_python=$(which ${PYTHON_EXECUTABLE})
HAVE=$(${possible_python} --version 2>&1 | awk '{ print $2 }')
# Stop if version is new enough
- if echo -e "${HAVE}\n3.6" | sort -V | head -1 | grep "^3.6$"
+ if echo -e "${HAVE}\n3.6" | sort -V | head -1 | grep -q "^3.6$"
then
PYTHON=${possible_python}
break
