我最近在我的Mac上安装了Homebrew,它抱怨在我的变量/usr/bin
之前发生,这意味着将使用系统提供的程序而不是使用Homebrew安装的程序。/usr/local/bin
$PATH
.bashrc
根据此截屏视频,我在一组单独的文件中配置。这意味着~/.bash_profile
看起来像这样:
if [ -f ~/.bashrc ];
then
source ~/.bashrc
fi
~/.bashrc
看起来像这样:
source ~/bin/dotfiles/bashrc
并且~/bin/dotfiles/bashrc
看起来是这样的:
. ~/bin/dotfiles/bash/env
. ~/bin/dotfiles/bash/config
. ~/bin/dotfiles/bash/aliases
~/bin/dotfiles/bash/env
,这是我设置我的$PATH
变量,看起来像这样:
export EDITOR="kom"
export PATH=some/path/at/start:usr/local/bin:/Users/jim/pear/bin:~/bin:/Users/jim/.gem/ruby/1.8/bin:/Users/jim/bin/bashscripts:some/path/at/end:$PATH
我已添加some/path/at/start
并some/path/at/end
用于调试目的,因为当我尝试时,echo $PATH
我得到这个:
/opt/local/bin:/opt/local/sbin:/Users/jim/bin:/opt/local/bin:/opt/local/sbin:some/path/at/start:usr/local/bin:/Users/jim/pear/bin:/Users/jim/bin:/Users/jim/.gem/ruby/1.8/bin:/Users/jim/bin/bashscripts:some/path/at/end:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
也就是说,在我上面概述的配置中,有一些其他东西被加载到$ PATH变量中,我无法控制。关于这些东西从哪里加载的任何想法,以便我可以去改变它并移动/usr/local/bin
之前/usr/bin
?