我是靠谱客的博主 美丽诺言,这篇文章主要介绍mac terminal not auto load bashrc,现在分享给大家,希望可以做个参考。

bashrc居然没有被自动的加载让我很吃惊, yahoo之后找到了办法如下:

I figured out this diagram by adding echo "${BASH_SOURCE[0]}" to those scripts.

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
+-----------------+ +------FIRST-------+ +-----------------+ | | | ~/.bash_profile | | | login shell -------->| /etc/profile |-->| ~/.bash_login ------>| ~/.bashrc | | | | ~/.profile | | | +-----------------+ +------------------+ +-----------------+ +-----------------+ +-----------------+ | | | | interactive shell -->| ~/.bashrc -------->| /etc/bashrc | | | | | +-----------------+ +-----------------+ +-----------------+ | | logout shell ------->| ~/.bash_logout | | | +-----------------+

Note

  1. []-->[] means source by workflow (Automatically).
  2. [--->[] means source by convention (Manually. If not, nothing happen.).
  3. FIRST means find the first available, ignore rest
最后的解决办法:

what does your .bash_profile look like? I just set mine up with the following in my .bash_profile, and it's working.

if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

export PS1='[e[0;31m]u[e[0m][e[1;31m]@[e[0m][e[0;31m]H[e[0m] w $ '
source ~/.bashrc

最后

以上就是美丽诺言最近收集整理的关于mac terminal not auto load bashrc的全部内容,更多相关mac内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(93)

评论列表共有 0 条评论

立即
投稿
返回
顶部