source~/.bash_profile每次重启不生效问题
1 | source ~/.bash_profile |
每次设置好环境变量后,保存当前设置,只在 当前命令窗口 下生效!
问题
.bash_profile中修改环境变量只对当前窗口有效,而且需要source ~/.bash_profile才能使用.zshrc则相当于开机启动的环境变量
你也可以在.zshrc文件中加一行source .bash_profile解决需要source才能使用的问题
编辑~/.zshrc文件
1 | vim ~/.zshrc |
增加以下内容,保存
1 | source ~/.bash_profile |
评论
