]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - bash/rc
Simplified loading of config files by using a function.
[config/dotfiles.git] / bash / rc
1 # Main bash configuration file.
2
3
4 # Get the current hostname (first part before a dot).
5 host=$(echo $(hostname) | sed -e 's/\..*$//')
6
7 # Load environmental related settings used by all shells.
8 if [ -f ~/.shell/env ]; then
9     source ~/.shell/env
10 else
11     function source_config() {
12         echo "Couldn't load source_config(), can't source files." >&2
13     }
14 fi
15
16 # Load global env file for current hostname (first part before a dot) or
17 # global env.local.
18 source_config ~/.shell "" env $host
19
20
21 # Use Vi(m) style in bash.
22 set -o vi
23
24
25 # Load rc file for current hostname (first part before a dot) or rc.local.
26 source_config ~/.bash "" rc $host