美文网首页程序猿大本营
Mac 每次都要执行source ~/.bash_profile

Mac 每次都要执行source ~/.bash_profile

作者: 雅致坊 | 来源:发表于2019-12-10 10:32 被阅读0次

自己在 ~/.bash_profile 中配置环境变量, 可是每次重启终端后配置的不生效.需要重新执行 : $source ~/.bash_profile

发现zsh加载的是 ~/.zshrc文件,而 ‘.zshrc’ 文件中并没有定义任务环境变量。

解决办法

在~/.zshrc文件最后,增加一行:

source ~/.bash_profile

ok,完美解决了问题。

相关文章

网友评论

    本文标题:Mac 每次都要执行source ~/.bash_profile

    本文链接:https://www.haomeiwen.com/subject/axiwgctx.html