diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2012-06-11 15:19:18 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2012-06-11 15:19:18 +1200 |
commit | 8ea38fed5a6fda7e7975a19ba9815829ac6ba2eb (patch) | |
tree | af48a4bae5b467bfeb298dd0d35a7eb16a9e7f1b /bash | |
parent | Improve comment on prompt command. (diff) | |
download | dotfiles-8ea38fed5a6fda7e7975a19ba9815829ac6ba2eb.tar.gz dotfiles-8ea38fed5a6fda7e7975a19ba9815829ac6ba2eb.zip |
Fix overloading init scripts
Diffstat (limited to 'bash')
-rw-r--r-- | bash/bash_profile | 8 | ||||
-rw-r--r-- | bash/bashrc | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/bash/bash_profile b/bash/bash_profile index 46564da0..85ef5e21 100644 --- a/bash/bash_profile +++ b/bash/bash_profile @@ -8,7 +8,13 @@ DIRS="${HOME}/bin /usr/local/nagios/bin /usr/local/pgsql/bin" for DIR in $DIRS; do - [[ -d "$DIR" ]] && PATH="${DIR}:${PATH}" + if [[ -d "$DIR" ]] && [[ ":${PATH}:" != *":${DIR}:"* ]]; then + if [[ -n "$PATH" ]]; then + PATH="${DIR}:${PATH}" + else + PATH=$DIR + fi + fi done # None of this UTF8 drawing characters nonsense. diff --git a/bash/bashrc b/bash/bashrc index adac8b2c..3f9b680d 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -15,7 +15,7 @@ HISTCONTROL=ignoreboth HISTTIMEFORMAT='%F %T ' # Add history entries immediately, not on exit. -PROMPT_COMMAND="history -a; ${PROMPT_COMMAND}" +PROMPT_COMMAND='history -a' # Don't check for mail all the time, it's irritating. unset MAILCHECK @@ -64,6 +64,10 @@ esac # Figure out how many colors we have now. hash tput && COLORS=$(tput colors) +# Reset options for ls and grep. +LS_OPTS= +GREP_OPTS= + # If we have a color terminal, we'll use color for ls and grep. if [[ $COLORS -ge 8 ]]; then hash dircolors &>/dev/null && eval "$(dircolors -b)" |