I am creating an install script where I would like to compare the version of installed default Python with the version I need to have running. Currently here is my code:
#!/bin/bash
PYTHON="$(python -V)"
if [[ "$PYTHON = 'Python 2.7.6' ]]
then echo "Python is installed."
else echo "Python is not installed."
fi
The response I keep getting is that Python is not installed, but that is the output when I type in the command python -V.
Any help is greatly appreciated. Thank you in advance.