The environment variable configured by source ~ / .bash_profile must be executed every time the Mac takes effect

Configure the environment variables in ~ / .bash_profile yourself, but the configuration will not take effect every time you restart the terminal. You 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

Edit the ~ / .zshrc file and add a line at the end:
source ~ / .bash_profile

 

  Get it done ~

Guess you like

Origin www.cnblogs.com/chenyanbin/p/12748597.html