-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbash.bashrc
58 lines (52 loc) · 1.1 KB
/
bash.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
# if the command-not-found package is installed, use it
if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found ]; then
function command_not_found_handle {
# check because c-n-f could've been removed in the meantime
if [ -x /usr/lib/command-not-found ]; then
/usr/bin/python /usr/lib/command-not-found -- $1
return $?
elif [ -x /usr/share/command-not-found ]; then
/usr/bin/python /usr/share/command-not-found -- $1
return $?
else
return 127
fi
}
fi
# function to print colorful words in shell
function ecolor()
{
case $1 in
black)
color=30
;;
red)
color=31
;;
green)
color=32
;;
yellow)
color=33
;;
blue)
color=34
;;
white)
color=37
;;
*)
echo $2
return 1
;;
esac
echo -e "\033[49;${color};1m$2\033[0m"
return 0
}
# load bashrc.local ,put some uncompetical config file here
if [ -f /etc/bashrc.local ]; then
. /etc/bashrc.local
fi
if [ -f /home/zs/linuxetc/alias.bashrc ]; then
. /home/zs/linuxetc/alias.bashrc
fi