macos Snow Leopard 上 .profile 和 .bash_profile 的区别
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6751252/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Difference between .profile and .bash_profile on Snow Leopard
提问by redconservatory
I am going to set the path for mySQl on my computer (I'm running Snow Leopard) but I see different instructions online.
我将在我的计算机上设置 mySQl 的路径(我正在运行 Snow Leopard),但我在网上看到了不同的说明。
Some say to change the .profile file and some say to change the .bash_profile file. What is the difference?
有人说要更改 .profile 文件,有人说要更改 .bash_profile 文件。有什么区别?
回答by Paul R
.profile
works with sh
or bash
. However .bash_profile
is bash-specific and will override .profile
if present.
.profile
与sh
或 一起使用bash
。但是.bash_profile
是特定于 bash 的,.profile
如果存在,将覆盖。
回答by hlim
I believe mac OS X environment checks .bash_profile
, .bash_login
, .profile
in this order. It will run whichever is the highest in the hierarchy, so, if you have .bash_profile
, it will not check .profile
.
我相信,Mac OS X环境检查.bash_profile
,.bash_login
,.profile
在这个秩序。它将运行层次结构中最高的那个,所以,如果有.bash_profile
,它不会检查.profile
.