]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - bash/rc
eb672889360374c13d7e2f8009690dd26dd84d9a
[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 the default file exists, load it.
9 if [ -f ~/.shell/env ]; then
10     source ~/.shell/env
11 fi
12 # If an env file for the current hostname (first part before a dot) exists load
13 # it, otherwise load env.local if available.
14 if [ -f ~/.shell/env.$host ]; then
15     source ~/.shell/env.$host
16 elif [ -f ~/.shell/env.local ]; then
17     source ~/.shell/env.local
18 fi
19
20
21 # Use Vi(m) style in bash.
22 set -o vi
23
24
25 # If a rc file for the current hostname (first part before a dot) exists load
26 # it, otherwise load rc.local if available.
27 if [ -f ~/.bash/rc.$host ]; then
28     source ~/.bash/rc.$host
29 elif [ -f ~/.bash/rc.local ]; then
30     source ~/.bash/rc.local
31 fi