The path of export is invalid when zsh is opened

Reference: https://blog.csdn.net/science_Lee/article/details/79214127
Configure environment variables in ~/.bash_profile by yourself, but the configuration does not take effect after restarting the terminal every time. Need to re-execute: $source ~/.bash_profile

It is found that zsh loads the ~/.zshrc file, and the task environment variable is not defined in the '.zshrc' file.

Solution

At the end of the ~/.zshrc file, add a line:
source ~/.bash_profile

Remember to export the corresponding path in bash_profile

There is another solution
, remember to add PATH with "" (this problem does not exist in bashrc)
insert image description here

Guess you like

Origin blog.csdn.net/qq_21237549/article/details/130324156
zsh