I modify my .bashrc frequently and then source it. However, when I have things like
export PATH="~/bin:~/perl5/bin:$PATH"
in my file, then the PATH
environment variable grows every time I source the file.
For example, the first time .bashrc is sourced, the PATH
variable consists of ~/bin:~/perl5/bin:/usr/bin:/bin
.
The second time it consists of ~/bin:~/perl5/bin:~/bin:~/perl5/bin:/usr/bin:/bin
.
The third time it consists of ~/bin:~/perl5/bin:~/bin:~/perl5/bin:~/bin:~/perl5/bin:/usr/bin:/bin
.
Is there a simple way to make it only add anything that isn't already in the PATH?