Add directory to $PATH if it's not already there
- by Doug Harris
Has anybody written a bash function to add a directory to $PATH only if it's not already there?
I typically add to PATH using something like:
export PATH=/usr/local/mysql/bin:$PATH
If I construct my PATH in .bash_profile, then it's not read unless the session I'm in is a login session -- which isn't always true. If I construct my PATH in…