I am trying to add a python path value to a different environment, as some script I run with another user needs it to be set.
Now, the weird thing is that when I run sudo -E
, variables that I have in my env
do pass on to the user I'm sudo
ing to- except that PYTHONPATH doesn't.
Running:
TESTVAR=testValue sudo -E bash -c 'echo $TESTVAR'
will print "testValue", but:
PYTHONPATH=testValue sudo -E bash -c 'echo $PYTHONPATH'
Won't print anything.
I'm trying to understand if there is anything special about specific variables, that sudo acts different with when passing them to a different environment.
Help will be much appreciated, Thanks.
sudo -V
as root?