Created
August 26, 2014 19:20
-
-
Save alexdlaird/306837af380eb74061fe to your computer and use it in GitHub Desktop.
Force default shell to Bash. This is especially useful when user does not exist in /etc/passwd. Place this snippet at the end of /etc/profile or ~/.profile.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case $- in | |
*i*) | |
# If $BASH is not defined then we're already in a Bash shell | |
if [ -z "$BASH" ]; then | |
BASH_BIN=$(command -v bash) | |
# Ensure Bash is installed on the system, then switch shells | |
if [ -x "$BASH_BIN" ]; then | |
export SHELL="$BASH_BIN" | |
exec "$BASH_BIN" | |
fi | |
fi | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment