问题:
What is the proper way to modify environment variables like PATH in OS X? 在OS X中修改环境变量(如PATH)的正确方法是什么?
I've looked on Google a little bit and found three different files to edit: 我稍微看了一下Google,发现需要编辑三个不同的文件:
- /etc/paths / etc /路径
- ~/.profile 〜/ .profile
- ~/.tcshrc 〜/ .tcshrc
I don't even have some of these files, and I'm pretty sure that .tcshrc is wrong, since OS X uses bash now. 我什至没有这些文件,而且我很确定.tcshrc是错误的,因为OS X现在使用bash。 Where are these variables, especially PATH, defined? 这些变量(尤其是PATH)在哪里定义?
I'm running OS X v10.5 (Leopard). 我正在运行OS X v10.5 (Leopard)。
解决方案:
参考一: https://stackoom.com/question/ZIW/在OS-X上设置环境变量参考二: https://oldbug.net/q/ZIW/Setting-environment-variables-on-OS-X
来源:oschina
链接:https://my.oschina.net/stackoom/blog/4322415