Make more function variables local to avoid polluting the environment
[config/bash.git] / .bashrc
1 #!/bin/bash
2 # ~/.bashrc: executed by bash(1) for non-login shells.
3
4 # If not running interactively, don't do anything
5 case $- in
6     *i*) ;;
7       *) return;;
8 esac
9
10 # system-wide bash completion
11 [ -f /etc/bash_completion ] && . /etc/bash_completion
12
13 # user-defined aliases
14 aliases_dir="$HOME/.bash/aliases.d"
15 if [[ -d $aliases_dir && -r $aliases_dir && -x $aliases_dir ]]; then
16   for i in "$aliases_dir"/*; do
17     [[ -f $i && -r $i ]] && . "$i"
18   done
19 fi
20 unset aliases_dir i
21
22 # env variables
23 [ -f ~/.bash/env ] && . ~/.bash/env
24
25 # LOCAL env variables, these settings are not meant to be shared
26 [ -f ~/.bash/env_local ] && . ~/.bash/env_local
27
28 # load git prompt support
29 [ -f /usr/lib/git-core/git-sh-prompt ] && . /usr/lib/git-core/git-sh-prompt
30
31 # load function to set custom shell prompts
32 if [ -f ~/.bash/bash_prompt/set_prompt ];
33 then
34   . ~/.bash/bash_prompt/set_prompt
35
36   # set a different prompt for the root user
37   if [ $UID -eq 0 ];
38   then
39     set_prompt fire
40   else
41     set_prompt iceg
42   fi 
43 fi