# 位于/etc/profile文件
for i in /etc/profile.d/*.sh /etc/profile.d/sh.local ; do
if [ -r "$i" ]; then
if [ "${-#*i}" != "$-" ]; then
. "$i"
else
. "$i" >/dev/null
fi
fi
done
# 位于/etc/bashrc文件
for i in /etc/profile.d/*.sh; do
if [ -r "$i" ]; then
if [ "$PS1" ]; then
. "$i"
else
. "$i" >/dev/null
fi
fi
done
~/.bashrc加载
#位于~/.bash_profile文件
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
/etc/bashrc加载
# 位于~/.bashrc文件
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi