Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I upgrade Bash in Mac OSX Mountain Lion and set it the correct path? [closed]

since Mountain Lion still uses the old bash 3.x, I was wondering if there is a good tutorial (or if somebody could post one here) on how to upgrade bash to the latest version. Also, it would be helpful to know how to set the path so that it can be used in terminal.

Thanks in advance

like image 776
Tom Avatar asked May 07 '13 09:05

Tom


People also ask

How do I change bash version on Mac?

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.

Does mac come with bash?

Mac OS X comes with the Bourne Again SHell (bash) as the default user shell and also includes the TENEX C shell (tcsh), the Korn shell (ksh), and the Z shell (zsh). bash, ksh, and zsh are compatible with sh, the original Bourne shell.


1 Answers

  • Update brew: brew update
  • Install bash with brew install bash
  • Add /usr/local/bin/bash to /etc/shells
  • Change the default shell with chsh -s /usr/local/bin/bash

You don't normally have to change any settings in Terminal or iTerm 2. Both of them default to opening new shells with the default login shell.

like image 186
k107 Avatar answered Sep 30 '22 08:09

k107