0

我认为 macports 设置 $PATH 的唯一方法是通过 ~/.bash_profile 或 ~/.profile。我检查过我没有 ~/.bashrc。但是在注释掉行之后:

 #export PATH=/opt/local/bin:/opt/local/sbin:$PATH

我的 $PATH 中仍然有 /opt/local/bin

$echo $PATH
/opt/local/bin:/opt/local/sbin:/usr/local/texlive/2012/bin/x86_64-darwin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/texbin

我想知道 macport 在哪里更改了我的 PATH 变量,它应该是在加载 ~/.bash_profile 之后,因为我在 ~/.bash_profile 的路径开头添加了 texlive 路径。

4

1 回答 1

0

在 OSX 上,启动交互式 bash 终端时执行的文件顺序如下:

/etc/profile
/etc/bashrc
~/.bash_profile

它必须是其中之一。查看macports留下的评论.bash_profile留下的评论就在那里。

于 2014-07-05T04:06:26.333 回答