一、問題描述
Mac配置好了環境變量文件(.bash_profile)后,每次打開終端都需要執行一遍source ~/.bash_profile才能使環境變量生效,這樣很是麻煩;
二、解決方法
1.創建.zshrc文件(如果已經有了就無須創建)
????$ touch .zshrc
2.編輯.zshrc文件
? ? open .zshrc
3.向.zshrc中添加如下內容
????source ~/.bash_profile? ??
Mac配置好了環境變量文件(.bash_profile)后,每次打開終端都需要執行一遍source ~/.bash_profile才能使環境變量生效,這樣很是麻煩;
????$ touch .zshrc
? ? open .zshrc
????source ~/.bash_profile? ??