Mac系統(tǒng)的環(huán)境變量,加載順序為:
/etc/profile -> /etc/paths -> /etc/paths.d/文件夾所有內(nèi)容 -> ~/.bash_profile -> ~/.bash_login -> ~/.profile -> ~/.bashrc
需要注意的點:
- paths.d是一個文件夾,其下所有文件內(nèi)包含的路徑都會被添加
- .bash_profile中的語句需要注意,如果使用了Export,需要注意$path變量與新的路徑的組合關系,可能會影響到路徑的排序。