From d87c87c2510313f23bc9a6a22b19b0e998ee8d5b Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 26 May 2013 13:57:24 +1200 Subject: More intelligent PATH calculation --- bash/bashrc | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/bash/bashrc b/bash/bashrc index 06bca1ea..742f58ee 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -66,22 +66,22 @@ hash stty &>/dev/null && stty -ixon # Use completion, if available. [[ -e /etc/bash_completion ]] && source /etc/bash_completion -# Add various paths if they exist and aren't already in here. -pathdirs="${HOME}/bin - /usr/local/apache/bin - /usr/local/mysql/bin - /usr/local/nagios/bin - /usr/local/pgsql/bin" +# Add various binary paths if they exist +pathdirs="${HOME}/.local/bin + ${HOME}/bin + /usr/local/apache/bin + /usr/local/mysql/bin + /usr/local/nagios/bin + /usr/local/pgsql/bin" for pathdir in $pathdirs; do - if [[ -d "$pathdir" ]] && [[ ":${PATH}:" != *":${pathdir}:"* ]]; then - if [[ -n "$PATH" ]]; then - PATH="${pathdir}:${PATH}" - else - PATH=$pathdir - fi - fi + [[ -d "$pathdir" ]] \ + && PATH="${pathdir}:${PATH}" done +# Add various manual paths if they exist +[[ -d "${HOME}/.local/share/man" ]] \ + && MANPATH="${HOME}/.local/share/man:${MANPATH}" + # Figure out how many colors we have now. hash tput && colors=$(tput colors) -- cgit v1.2.3