bash-completion: Other Bourne-like Shells Trip Over /etc/profile.d/bash_completion.sh, which contains bashisms
Upon login, /etc/profile sources each file in /etc/profile.d/*.sh. When the bash-completion package is installed, /etc/profile.d/bash_completion.sh exists, and has code which attempts to detect that it is running inside bash, but the script itself contains bashisms, and so other shells get an error when they parse it. This produces an error message for all users with Bourne-like shells that aren’t bash, and it completely breaks logins from display managers such as LXDM.
Solution: Removal of bash-completion will restore display manager logins and prevent the error message to shell logins, but it’s not a true fix. One fix is to remove the bashisms from /etc/profile.d/bash_completion.sh. Another (I’m doing this currently.) is to make /etc/profile.d/bash_completion.sh a wrapper which uses pure Bourne syntax to test if it’s running inside bash, at which point it can source /etc/profile.d/bash_completion (without the extension) or from some other, better location.
(from redmine: issue id 6770, created on 2017-01-29)