문제

I remember after a fresh install of os x, when i did a echo $PATH in the terminal, it responded with a blank line. Now after installing some tools over time, the $PATH variable has /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin value although my .bash_profile is blank. I was wondering where this value is being set?

도움이 되었습니까?

해결책

Plausible candidates would be /etc/profile and /etc/bashrc; there's also /etc/paths and /etc/paths.d to look at. You might also need to look at $HOME/.profile and $HOME/.bashrc. There might be some other places that bash looks too.

다른 팁

As of macOS Catalina, Mac defaults the shell to zsh (Z shell). This type of shell uses .zprofile instead of .bash_profile. To check if you are on bash or zsh, run echo $SHELL. If the result is bin/zsh, you are on zsh. In which case edit your ~/.zprofile for env variables.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top