29 terminal bash .profile macos
这个问题我已经很久了。运行终端 .profile 后,.bashrc 文件不起作用(未执行)。你能指出我应该在哪里寻找问题的根源吗?
小智 40
我.profile没有运行也有类似的问题。事实证明(如Apple StackExchange answer 中所述),如果您有.bash_profile或.bash_login文件,那么您.profile将被 bash 忽略。
小智 17
我想这个问答应该交给超级用户,但无论如何:
根据手册页的调用部分,
/etc/profile并~/.profile为交互式登录外壳读取,以及~/.bashrc 为交互式非登录外壳读取。如果您的其他 UNIX 机器~/.bashrc即使对于交互式登录 shell 也能自动读取,那是因为系统范围/etc/
profile内有一行读取~/.bashrc. OS X 的系统范围/etc/profile内没有。
因此,如果您~/.bashrc甚至想为交互式登录 shell 运行,则需要包含一行
. ~/.bashrc
Run Code Online (Sandbox Code Playgroud)
在您的~/.profile.
| 归档时间: |
|
| 查看次数: |
16675 次 |
| 最近记录: |