Pet*_*ter 12 macos bash .bash-profile
我不确定发生了什么,但我的〜/ .profile不再加载了.
以下任何人都可以看到错误吗?
export PS1="\u@local [\w]# "
export EDITOR="subl -w"
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
alias vst="ssh -i ~/.ssh/vst root@vst"
Run Code Online (Sandbox Code Playgroud)
我知道使用PS1这样的事实,就像我试图做的那样应该这样做,Peter@local [~/path/to/file]#但事实并非如此.
有任何想法吗?
ken*_*orb 14
在Unix FAQ(OS X)中,我们可以阅读:
Bash启动文件
当"登录shell"启动时,它会读取文件
/etc/profile然后~/.bash_profile或者~/.bash_login或者~/.profile(无论哪一个存在 - 它只读取其中一个,按照提到的顺序检查它们).当"非登录shell"启动时,它会读取文件
/etc/bashrc,然后读取文件~/.bashrc.请注意,当使用名称调用bash时
sh,它会尝试模仿Bourne shell(sh)的启动顺序.特别是,默认情况下调用的非登录shellsh不会读取任何点文件.有关详细信息,请参阅bash手册页.
因此,如果您已经~/.bash_profile,~/.profilebash不会自动读取该文件,因此您可以在其中添加以下行~/.bash_profile以加载它:
# Load user profile file
if [ -f ~/.profile ]; then
. ~/.profile
fi
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7739 次 |
| 最近记录: |