Last Updated: February 25, 2016
·
1.486K
· destructuring

Execute .xinitrc under bash

xinit uses sh to load .xinitrc, which can load incompatible bashisms in .bashrc if the login shell is /bin/bash. Ideally xinit reads something to load /bin/bash but here's a workaround at the top of .xinitrc:

if [[ x"$BASH" != x"/bin/bash" ]]; then
  exec /bin/bash "$HOME/.xinitrc"
fi