blob: 7fea250b97ca42a485cb2a706e2045752499c443 (
plain) (
blame)
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
|
# Add ~/.local/bin to PATH if it exists
if [ -d "$HOME"/.local/bin ] ; then
PATH=$HOME/.local/bin:$PATH
fi
# Load all supplementary scripts in ~/.profile.d
for sh in "$HOME"/.profile.d/*.sh ; do
[ -e "$sh" ] && . "$sh"
done
unset -v sh
# Trap on exit to run ~/.logout if it exists
logout_trap() {
if [ -f "$HOME"/.logout ] ; then
. "$HOME"/.logout
fi
if [ "$1" != EXIT ] ; then
trap - "$1"
kill "-$1" "$$"
fi
}
for sig in EXIT HUP INT TERM ; do
trap "logout_trap $sig" "$sig"
done
unset -v sig
# If ENV is unset after running those scripts and ~/.shrc exists, set it as ENV
if [ -z "$ENV" ] && [ -f "$HOME"/.shrc ] ; then
ENV=$HOME/.shrc
export ENV
fi
|