http://buddylindsey.com/upgrade-bash-to-4-on-os-x/

Unfortunately, Apple has decided to ship an old version of bash shell. When I go back and forth between linux and OSX sometimes I hit minor inconsistencies because of this. One big one is the git-prompt scripts. As such I finally decided to upgrade to version 4 of bash.

It is a very easy process, 2 minutes, and you are on your way. First, though you need homebrew installed and up-to-date.

Steps

Installation

1
brew install bash

Add it to Your Shells

You need to add it to your shells which is easy. Add the following line to `/etc/shells`

1
/usr/local/bin/bash

Change Your Shell

1
chsh

change the line that has Shell to the location that your newly brew installed bash is located.

1
Shell: /usr/local/bin/bash

Restart Terminal

Close your terminal and open it again.

Verification

To see your current version of bash do the following:

1
echo $BASH_VERSION

It should echo something like `4.2.45(2)-release`

Conclusion

It is that simple. I though it would be hard until I did it.

相关文章:

  • 2021-11-25
  • 2021-06-29
  • 2021-12-21
  • 2021-12-02
  • 2022-12-23
  • 2021-07-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-20
  • 2021-09-20
  • 2021-11-25
  • 2021-06-21
  • 2022-12-23
  • 2021-09-18
  • 2021-10-23
相关资源
相似解决方案