I want to automatically record my python version in a computerinfo file. However
python2 -V >> myfile
prints only to the console but not to myfile
. How can I get the output into a file?
Curiously, for python3 -- python3 -V >> myfile
-- this works as I expected.
I am on Ubuntu 16.04 and I use the bash shell.