2012-07-24 03:42:50 +00:00
|
|
|
# /etc/profile
|
|
|
|
|
2020-09-24 23:22:47 +00:00
|
|
|
# Append "$1" to $PATH when not already in.
|
|
|
|
# This function API is accessible to scripts in /etc/profile.d
|
|
|
|
append_path () {
|
2017-12-10 14:03:56 +00:00
|
|
|
case ":$PATH:" in
|
|
|
|
*:"$1":*)
|
|
|
|
;;
|
|
|
|
*)
|
2018-03-11 18:56:59 +00:00
|
|
|
PATH="${PATH:+$PATH:}$1"
|
2017-12-10 14:03:56 +00:00
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2020-09-24 23:22:47 +00:00
|
|
|
# Append our default paths
|
|
|
|
append_path '/usr/local/sbin'
|
|
|
|
append_path '/usr/local/bin'
|
|
|
|
append_path '/usr/bin'
|
2017-12-10 14:03:56 +00:00
|
|
|
|
2020-09-24 23:22:47 +00:00
|
|
|
# Force PATH to be environment
|
2012-07-24 03:42:50 +00:00
|
|
|
export PATH
|
|
|
|
|
|
|
|
# Load profiles from /etc/profile.d
|
|
|
|
if test -d /etc/profile.d/; then
|
|
|
|
for profile in /etc/profile.d/*.sh; do
|
|
|
|
test -r "$profile" && . "$profile"
|
|
|
|
done
|
|
|
|
unset profile
|
|
|
|
fi
|
|
|
|
|
2020-09-24 23:22:47 +00:00
|
|
|
# Unload our profile API functions
|
|
|
|
unset -f append_path
|
|
|
|
|
2020-05-06 13:29:37 +00:00
|
|
|
# Source global bash config, when interactive but not posix or sh mode
|
|
|
|
if test "$BASH" &&\
|
|
|
|
test "$PS1" &&\
|
|
|
|
test -z "$POSIXLY_CORRECT" &&\
|
|
|
|
test "${0#-}" != sh &&\
|
|
|
|
test -r /etc/bash.bashrc
|
|
|
|
then
|
2012-07-24 03:42:50 +00:00
|
|
|
. /etc/bash.bashrc
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Termcap is outdated, old, and crusty, kill it.
|
|
|
|
unset TERMCAP
|
|
|
|
|
|
|
|
# Man is much better than us at figuring this out
|
|
|
|
unset MANPATH
|