1 # Main bash configuration file.
3 # Is sourced by all interactive shells and other shells like scp or rcp.
6 # Get the current hostname (first part before a dot).
7 host=$(echo $(hostname) | sed -e 's/\..*$//')
9 # Load environmental related settings used by all shells.
10 if [ -f ~/.shell/env ]; then
12 # Fallback functions as ~/.shell/env couldn't be loaded.
14 function source_debug() {
17 function source_config() {
18 echo "Couldn't load source_config(), can't source files." >&2
22 source_debug "sourcing ~/.bash/rc"
24 # Load global env file for current hostname (first part before a dot) or
26 source_config ~/.shell "" env $host
29 # Check if this is an interactive shell. Abort if not to prevent problems with
30 # scp and rcp. Taken from default Debian bashrc. Thanks.
31 if [[ $- != *i* ]]; then
36 # Set the prompt; hostname and current working directory are displayed.
37 # Hostname is displayed in green, current directory in blue.
38 PS1='\[\033[01;32m\]\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] \$ '
40 # Use Vi(m) style in bash.
43 # Load aliases and similar functions also used by other shells.
44 if [[ -f ~/.shell/aliases ]]; then
49 # Load rc file for current hostname (first part before a dot) or rc.local.
50 source_config ~/.bash host rc $host
52 source_debug "finished sourcing ~/.bash/env"