1 # Main bash configuration file.
4 # Get the current hostname (first part before a dot).
5 host=$(echo $(hostname) | sed -e 's/\..*$//')
7 # Load environmental related settings used by all shells.
8 if [ -f ~/.shell/env ]; then
10 # Fallback functions as ~/.shell/env couldn't be loaded.
12 function source_debug() {
15 function source_config() {
16 echo "Couldn't load source_config(), can't source files." >&2
20 source_debug "sourcing ~/.bash/rc"
22 # Load global env file for current hostname (first part before a dot) or
24 source_config ~/.shell "" env $host
27 # Set the prompt; hostname and current working directory are displayed.
28 # Hostname is displayed in green, current directory in blue.
29 PS1='\[\033[01;32m\]\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] \$ '
31 # Use Vi(m) style in bash.
35 # Load rc file for current hostname (first part before a dot) or rc.local.
36 source_config ~/.bash host rc $host
38 source_debug "finished sourcing ~/.bash/env"