Centos7 has the following in /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
AND the following in /etc/bashrc
(which is run from ~/.bashrc
):
for i in /etc/profile.d/*.sh; do
if [ -r "$i" ]; then
if [ "$PS1" ]; then
. "$i"
else
. "$i" >/dev/null
fi
fi
done
Debian and Ubuntu only run these from /etc/profile
, which is what I would expect.
- why does Centos run them from both ?
- why the disparity in
sh.local
?