Ben Chuanlong Du's Blog

And let it direct your passion with reason.

The Right Way to Export PATH in Shell

Some people suggest exporting PATH only in .bash_profile instead of in .bashrc (for Bash). The helps but does not resolve the issue of possible duplicated paths in $PATH. The right way is to check for existence of the path in the $PATH environment variable first, and add it only when …