-
Notifications
You must be signed in to change notification settings - Fork 10
/
bashrc
73 lines (61 loc) · 1.9 KB
/
bashrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# This needs to get into your .bashrc somewhow
# for example: . .bash.d/bashrc
# Or just symlink this file as .bashrc or .bash_profile
# if you make sure this runs from
# .bash_profile instead of .bashrc or remove the
# interactive check from .bashrc then you can have the profile version
# of scripts run for all shells, not just interactive ones
if [ -f $HOME/.bash.d/local/profile/$(hostname)_.sh ]
then
source $HOME/.bash.d/local/profile/$(hostname)_.sh
fi
if [ -f $HOME/.bash.d/local/profile/${USER}@$(hostname)_.sh ]
then
source $HOME/.bash.d/local/profile/${USER}@$(hostname)_.sh
fi
if [ -f $HOME/.bash.d/os/profile/${OSTYPE}_.sh ]
then
source $HOME/.bash.d/os/profile/${OSTYPE}_.sh
fi
for i in $HOME/.bash.d/profile/*.sh; do source $i; done
unset i
if [ -f $HOME/.bash.d/local/profile/$(hostname).sh ]
then
source $HOME/.bash.d/local/profile/$(hostname).sh
fi
if [ -f $HOME/.bash.d/local/profile/${USER}@$(hostname).sh ]
then
source $HOME/.bash.d/local/profile/${USER}@$(hostname).sh
fi
if [ -f $HOME/.bash.d/os/profile/${OSTYPE}.sh ]
then
source $HOME/.bash.d/os/profile/${OSTYPE}.sh
fi
# If not running interactively, don't do anything
[[ "$-" != *i* ]] && return
if [ -f $HOME/.bash.d/local/$(hostname)_.sh ]
then
source $HOME/.bash.d/local/$(hostname)_.sh
fi
if [ -f $HOME/.bash.d/local/${USER}@$(hostname)_.sh ]
then
source $HOME/.bash.d/local/${USER}@$(hostname)_.sh
fi
if [ -f $HOME/.bash.d/os/${OSTYPE}_.sh ]
then
source $HOME/.bash.d/os/${OSTYPE}_.sh
fi
for i in $HOME/.bash.d/*.sh; do source $i; done
unset i
if [ -f $HOME/.bash.d/local/$(hostname).sh ]
then
source $HOME/.bash.d/local/$(hostname).sh
fi
if [ -f $HOME/.bash.d/local/${USER}@$(hostname).sh ]
then
source $HOME/.bash.d/local/${USER}@$(hostname).sh
fi
if [ -f $HOME/.bash.d/os/${OSTYPE}.sh ]
then
source $HOME/.bash.d/os/${OSTYPE}.sh
fi