Setting environment variables on OS X

后端 未结 30 3169
你的背包
你的背包 2020-11-21 05:15

What is the proper way to modify environment variables like PATH in OS X?

I\'ve looked on Google a little bit and found three different files to edit:

30条回答
  •  一生所求
    2020-11-21 05:58

    Well, I'm unsure about the /etc/paths and ~/.MacOSX/environment.plist files. Those are new.

    But with Bash, you should know that .bashrc is executed with every new shell invocation and .bash_profile is only executed once at startup.

    I don't know how often this is with Mac OS X. I think the distinction has broken down with the window system launching everything.

    Personally, I eliminate the confusion by creating a .bashrc file with everything I need and then do:

    ln -s .bashrc .bash_profile
    

提交回复
热议问题