Reasons to use an updated Bash
There can be different reasons why yo may need to upgrade the Bash on a MacOS system. In this case the reason was we need to execute some shell commands that were not available in the default bash shipped within the system:
declare -l lstring=“aBCDfe”
We also like to be able to use associative arrays. This is possible in Bash v4 for example.
So the steps you need to follow to upgrade Bash and hace this commands available are:
- Install "Home-brew" if not already in your system and install/update Bash
brew update; brew install bash
- Configure terminal to use the new version
sudo bash -c 'echo /usr/local/bin/bash >> /etc/shells'
- Change to the new shell
chsh -s /usr/local/bin/bash
Enjoy it !
0 comentarios:
Publicar un comentario