Fork me on GitHub

Mac每次都要执行source ~/.bash_profile配置的环境变量才生效

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

解决办法
zsh加载的是 ~/.zshrc文件,而 ‘.zshrc’ 文件中并没有定义任务环境变量。
在~/.zshrc文件最后,增加一行:
source ~/.bash_profile

image

posted @ 2024-01-04 13:51  秋夜雨巷  阅读(218)  评论(0编辑  收藏  举报