-
Notifications
You must be signed in to change notification settings - Fork 3
/
.profile
65 lines (59 loc) · 1.66 KB
/
.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# This file is read each time a login shell is started.
# All other interactive shells will only read .bashrc
# When you login (type username and password) via console,
# either sitting at the machine, or remotely via ssh:
# .profile is executed to configure your shell before the initial command prompt.
# manage PATH variable
pathremove() {
local IFS=':'
local rmpath="$1" # path to be removed
local newpath
local subpath
for subpath in $PATH; do
if [ $subpath != "$rmpath" ]; then
newpath="${newpath:+$newpath:}$subpath"
fi
done
export PATH="$newpath"
}
pathmunge() {
case ":${PATH}:" in
*:"$1":* | "$1:${PATH}:")
# $1 is already contained or $1 is NIL
;;
*)
if [ "$2" = "after" ]; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
esac
export PATH
}
case $(uname -s) in
Darwin) # macOS Terminal.app run login shell, which read bash_profile instead
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
export GEM_HOME="$(ruby -e 'puts Gem.user_dir')"
pathmunge "$GEM_HOME/bin"
;;
Linux)
test -z "$PROFILEREAD" && . /etc/profile || true
;;
*)
;;
esac
# NOTE: It is recommended to make language settings in ~/.profile rather than
# .bashrc, since multilingual X sessions would not work properly if LANG is over-
# ridden in every subshell.
#
# Most applications support several languages for their output.
# To make use of this feature, simply uncomment one of the lines below or
# add your own one (see /usr/share/locale/locale.alias for more codes)
# This overwrites the system default set in /etc/sysconfig/language
# in the variable RC_LANG.
#
# important for language settings, see below.
export LANG=en_US.UTF-8
export LC_CTYPE=$LANG