Last active
November 1, 2023 18:11
-
-
Save goodarzi/e2e8d03574a7a5c0d12f214535639b8c to your computer and use it in GitHub Desktop.
Install Bash 5.2 on macOS
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
# Install bash using HomeBrew | |
brew install bash | |
# Add new Bash to macOS shell list | |
sudo echo -e "/usr/local/bin/bash\n" >> /etc/shells | |
# Setup macOS .bashrc | |
[[ -f ~/.bashrc ]] || touch ~/.bashrc | |
grep -v '^\s*#' ~/.profile | grep '\. ~/\.bashrc\|source ~/\.bashrc' || echo -e "\n[[ '\$BASH' && -f ~/.bashrc ]] && . ~/.bashrc\n" >> ~/.profile | |
# Change default shell to Bash | |
chsh -s /usr/local/bin/bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment