Read completion files one by one.
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
elif [ -d /etc/bash_completion.d ]; then
- . /etc/bash_completion.d/*
+ for _compf in /etc/bash_completion.d/*; do
+ . $_compf
+ done
fi
elif [ "$SHELL" = /usr/local/bin/bash ]; then
if [ -d /usr/local/etc/bash_completion.d ]; then
- . /usr/local/etc/bash_completion.d/*
+ for _compf in /usr/local/etc/bash_completion.d/*; do
+ . $_compf
+ done
fi
else
echo "Unknown OS type, cannot source bash_completion" >&2