What is the proper way to modify environment variables like PATH in OS X?
I\'ve looked on Google a little bit and found three different files to edit:
There are two type of shells at play here.
It's important to understand here that with Bash, file .bashrc
is only read by a shell that's both interactive and non-login, and you will find that people often load .bashrc
in .bash_profile
to overcome this limitation.
Now that you have the basic understanding, let’s move on to how I would advice you to set it up.
.bash_file:
#!/bin/bash
source ~/.profile # Get the PATH settings
source ~/.bashrc # Get Aliases and Functions
#