I am a Mac user.
I want to install PYTHONPATH env for root. so
$ sudo su - # vi ~/.profile
and add to the file 'export PYTHONPATH = / mypythonlib'
then
# env
I see this line
PYTHONPATH=/Users/simpnet2/projects/meiji/src/hershey
and..
when i use sudo command i can't find that
$ sudo env
.. no PYTHONPATH
My program should work with the sudo command and needs to PYTHONPATH.
PYTHONPATH
If you use sh try /etc/profile, bash try /etc/bashrc, and if you use zsh try /etc/zshenv.
/etc/profile
/etc/bashrc
/etc/zshenv
PYTHONPATH sudoers. , visudo .
sudo -i, root ~root/.profile.
sudo -i
root
~root/.profile
10.8.5, .profile root (/var/root). bash "su -", .. "env" MacPorts .
MacBook-Pro:~ root# cat /var/root/.profile export MANPATH=/opt/local/share/man:$MANPATH export PATH=/opt/local/bin:/opt/local/sbin:$PATH MacBook-Pro:~ root# which port /opt/local/bin/port
, Linux , "sudo" . "sudo" .
, 'PYTHONPATH =/mypythonlib' 'sudo env', :
sudo PYTHONPATH=/mypythonlib env
: sudo. , "sudo" .
When I logged in as a regular user and called "su-root", I found that Mac OS 10.8.5 bash ignores .profile and .bash_profile; I could not change root $ PATH by editing these files. What editing / etc / paths worked. After exiting the root shell and entering again using "su-root", a new path appeared.