where is $PATH set? Specifically where is my mac port path being set? [closed]

天涯浪子 提交于 2019-12-04 03:53:40

问题


when i do

 echo $PATH

is see:

  /opt/local/bin:/opt/local/sbin:/opt/local/lib/postgresql84/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/local/mysql/bin:/usr/X11/bin

I want to move the /opt/local stuff to the end of the path because it is causing errors with gitk. (the same error specified here: Starting gitk Error)

I've already commented out the export PATH line in my .bash_profile, but my path is STILL set like the above. I also checked etc/paths.d but don't see anything for mac ports in there. I commented out a similar export PATH line in my .profile. Again my path is STILL containing /opt/local in the front. WHERE ELSE is this being set?

I'm using mac os snow leopard 10.6.8


回答1:


On my system, MacPorts installer put it into /etc/profile.

The (full?) list of files is as follows (in the order bash reads them):

/etc/profile
/etc/bashrc
~/.bash_profile
~/.bash_login
~/.profile
~/.bashrc



回答2:


Did you also check /etc/profile or /etc/paths? It seems to me if you commented it out from all the other places, those would be the places where they would be.



来源:https://stackoverflow.com/questions/7657903/where-is-path-set-specifically-where-is-my-mac-port-path-being-set

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!