I updated unsuccessfully my Bash to 3.2.48 by MacPorts.
It seems that I do not have it active, since I get
echo $BASH_VERSION 3.2.17(1)-release
How can you make the newest Bash active such that I get it for my login shell?
Change The Default Bash on Mac First, you will need to update the list of permitted shells by adding the bash brew version into /private/etc/shells . You can do this by editing directly the file or using the tee -a command as shown below. Finally, you will need to update your user's shell with the chpass command line.
To put that in perspective, the version of Bash used on your Mac was new when the first iPhone was introduced. Apple is likely using the older version because the licensing for the Bash shell changed from GNU GPL 2 (General Public License) to GNU GPLv3, which includes restrictions that could cause problems for Apple.
Default Bash Version on macOSThis version of Bash is included in all versions of macOS, even the newest one. The reason that Apple includes such an old version of Bash in its operating system has to do with licensing.
Run the following code, for instance to change your shell to the newest Bash installed by MacPorts
chsh -s /opt/local/bin/bash
If that gives you the message,
"
non-standard shell
"
you will need to add
/opt/local/bin/bash
to
/etc/shells
Note that /etc/shells
is just a text file, so you can edit it directly if you authenticate as root. You can programmatically change it by the command
sudo -s Password: # echo /opt/local/bin/bash >> /etc/shells
If your first chsh command failed, run it now again if you managed to change the above file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With