Last active
August 24, 2023 05:18
-
-
Save jaxvanyang/36fba71437be93ee4670f571900eba51 to your computer and use it in GitHub Desktop.
Workaround for changing the default shell if you don't have write permission of `/etc/passwd`.
This file contains 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
# change default shell from Bash to fish | |
if shopt -q login_shell; then | |
if ! command -v fish &> /dev/null; then | |
return | |
fi | |
clear | |
export SHELL=/usr/bin/fish | |
# clean Bash envs | |
unset -v HISTFILE HISTSIZE HISTTIMEFORMAT | |
exec /usr/bin/fish | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment