- #Upgrad bash on mac how to#
- #Upgrad bash on mac mac os x#
- #Upgrad bash on mac install#
- #Upgrad bash on mac update#
#Upgrad bash on mac how to#
If you need help getting this done, I'd be glad to post a step-by-step on how to do it. It was simple, required me to type three things on the command line, and the rest was pretty automatic - all in all, I say go for it.
#Upgrad bash on mac install#
So, to handle this: 1) install bash via Homebrew, as the other commenters have posted.
#Upgrad bash on mac update#
in fact, nothing at all happened except for now I have a bash 3.1 program, just as expected. So, what you want may not be the complete update of bash, but a side-by-side install that always returns the newer version of bash (i.e.
#Upgrad bash on mac mac os x#
You can even keep your old bash 2 in the same place (/bin), and install bash 3.0 in a location such as /usr/local/bin or something like that and flip-flop back and forth between the two if you so desire.Įdit: I just downloaded bash 3.1 from that site, configured and installed it in less than 15 minutes on a 500MHz G4 machine, and my Mac OS X installation is as perfect as it was before I did it - nothing catastrophic happened. If you want and need bash 3.0, it is even adviseable. You can download the source code from and compile it yourself and give it a try. it's just a program, and is a pretty ubiquitous program with Unix distributions. It's not buried deep within some cryptic place in Mac OS X, it's not intertwined with the OS in some way that could cause harm to your system, and it's not going to prevent you from using the Terminal and relegate you to using X11. it's simply a program, which you can run without incident just like any other program under Mac OS X. I don't see why one would think that this would somehow "screw up" or "mess up" Mac OS X in any way. You can download the source code for bash, then compile it yourself and set the Terminal and/or X11 to use your new executable, and it's completely possible to use bash 3.0 (or 3.1) as your default shell in Mac OS X without "massing the whole OS up" or causing any harm to your system.
GNU bash, version 4.4.12(1)-release (x86_64-apple-darwin16.6.0)Ĭopyright (C) 2016 Free Software Foundation, Inc.Bash is simply an executable program located in /bin. Note the "License GPLv3+" which is why Apple doesn't bundle it with macOS. If you open Terminal or iTerm2 and run bash -version you should see the new version.
Now the new bash is our default login shell. You can read more about this in Change the Shell in Mac OS X Terminal, but the actual command is very straightforward. So any sessions for that user will use that shell. Next we use chsh to make it your default shell. # Ftpd will not allow users to connect who are not using
After adding the new bash path my /etc/shells looks like the following: # List of acceptable shells for chpass(1). As described in /etc/shells, this file has the list of valid login shells. To make bash the default you need to do two more steps.įirst, add the Bash 4 path to your /etc/shells file so that it is an allowed login shell. Making Bash 4 the defaultĪs mentioned above, after installing Bash 4 is still not the default shell. You can also set the bash path for specific profiles in Terminal/iTerm2 using the steps described in answer. This will use the first bash on the PATH. Since it is on your PATH, you can start a Bash 4 session with just bash or it can be used in scripts by using a Shebang.įor example, this will use a specific bash instance. You can find where it is located by running which bash.
However, it is not yet your default shell. There are various ways of doing that, I prefer Homebrew.īash 4 is now available on your PATH (assuming Homebrew bin is on your path). Install Bash 4 via Homebrewįirst install the newer version of bash. You can install bash 4+ however and also can make it your default shell (including for Terminal and iTerm2) by doing the following. As said in his answer, Apple does not provide bash 4 due to GPL restrictions.