-
Notifications
You must be signed in to change notification settings - Fork 0
/
bash_profile
50 lines (32 loc) · 1.1 KB
/
bash_profile
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
#!/bin/bash
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
source_bash_files() {
declare -r CURRENT_DIRECTORY="$(pwd)"
declare -r -a FILES_TO_SOURCE=(
"bash_aliases"
"bash_autocomplete"
"bash_exports"
"bash_functions"
"bash_options"
"bash_prompt"
"bash.local" # For local settings that should
# not be under version control.
)
local file=""
local i=""
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
for i in ${!FILES_TO_SOURCE[*]}; do
file="$HOME/.${FILES_TO_SOURCE[$i]}"
[ -r "$file" ] \
&& . "$file"
done
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
cd "$CURRENT_DIRECTORY"
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
source_bash_files
unset -f source_bash_files
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Clear system messages (system copyright notice, the date
# and time of the last login, the message of the day, etc.).
clear