配置文件 不生效原因
vim ~/.bash_profile
执行了source ~/.bash_profile 执行后路径配置是生效的。但重新打开终端后,路径配置又不生效了。
原因:macOS用的默认终端是zsh,执行的是~/.zshrc文件,不会直接执行~/.bash_profile文件。
解决办法:
vim ~/.zshrc
# zshrc 文件 末尾新增如下内容
source ~/.bash_profile
配置文件 不生效原因
vim ~/.bash_profile
执行了source ~/.bash_profile 执行后路径配置是生效的。但重新打开终端后,路径配置又不生效了。
原因:macOS用的默认终端是zsh,执行的是~/.zshrc文件,不会直接执行~/.bash_profile文件。
解决办法:
vim ~/.zshrc
# zshrc 文件 末尾新增如下内容
source ~/.bash_profile