10.4: Update to a newer bash shell

Sep 06, '06 07:30:00AM

Contributed by: Anonymous

Open Terminal, and at the command prompt type bash --version. You're likely to see something like GNU bash, version 2.05b.0(1)-release (powerpc-apple-darwin8.0) -- at least if you're on Tiger, that is. Note that you'll have a powerpc version of bash, even if you're on an Intel powered Mac! Here's how I converted to a newer, Intel compiled version.

I installed a newer bash through Fink; the latest version is in the unstable tree, so you may have to modify your Fink config file. Once that's done, just type fink install bash to install. Since I wanted to be able to switch to the old version of bash, if need be, I created a symlink here:

ln -s /sw/bin/bash /usr/bin/bash
Then I updated my NetInfo profile to use /usr/bin/bash as the default shell (which in turn specifies the default shell to /usr/bin/login). I used the GUI NetInfo Manager, but you could use nicl and niutil commands if you're brave. So if something should go wonky with the 'unstable' version of bash, I can login remotely, change the symlink /usr/bin/bash from /sw/bin/bash back to the default of /bin/bash.

One could also change the Terminal preference to call the symlink, instead of using NetInfo to modify /usr/bin/login -- but the NetInfo way feels more canonical. Now type bash --version, and you should have (assuming an Intel-powered Mac) GNU bash, version 3.00.0(1)-release (i386-apple-darwin8.7.1), a whole point update, and Intel native!

Comments (22)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20060831233511965