It is because /etc/profile.d/ is used only by interactive login shell. However,
/etc/bash.bashrc is used by interactive non-login shell.
As I usually do set some global aliases for system, I have started to create
/etc/bashrc.d where I can drop a file with some global aliases:
HAVE_BASHRC_D=`cat /etc/bash.bashrc | grep -F '/etc/bashrc.d' | wc -l`
if [ ! -d /etc/bashrc.d ]; then
mkdir -p /etc/bashrc.d
if [ "$HAVE_BASHRC_D" == "0" ]; then
echo "Setting up bash aliases"
if [ -d /etc/bashrc.d ]; then
for i in /etc/bashrc.d/*.sh; do
if [ -r $i ]; then
) >> /etc/bash.bashrc