Example command is as follows, run as a normal user
which python /home/me/env/development/python
PATH environment contains a path that points out to this instance of
python (instead to point to
I want to be able to run a python command with the SAME environment variable, so
sudo which python
/usr/bin/python instead. Using the
-E option gives the same result.
How can I run a python command with root-right, but with the environment variables preserved. I do not want to specify them all with the sudo command, and I guess to 'copy' only the
PATH variables should be enough.
Question formulated in other words: How can I run a python command with
sudo, which has the same
PATH definition as I currently have as a normal user?