I'm trying to write a short script to log certain environment variables of my current shell session to file. Unfortunately the output of "python --version" seems to ignore (?) the >> operator and prints to the shell instead to the file.
My minimal (not) working example:
rm path.log
echo "python --version" >> path.log
python --version >> path.log
I would expect that the file path.log would then have the following content:
python --version
Python 2.6.6
But the line "Python 2.6.6" is printed to the shell and not to the file. How can I fix this?
Thank you!
PS: This works completely fine for
gcc --version