Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install Bash >= 3.2.25 on Mac OS X 10.5.8?

I'm following Michael Hartl's Rails tutorial, so far I've installed Git 1.7.5.4 x86_64 (I'm running OSX 10.5.8) and I'm trying to install rvm

After I run the following:

$ curl -kL get.rvm.io | bash -s stable

I get:

BASH 3.2.25 required (you have 3.2.17(1)-release) 

I've tried changing the shell, using chsh -s /opt/local/bin/bash but I get shell '/opt/local/bin/bash' does not exist

Not sure where to go from here but I'd appreciate any guidance. Thanks!

like image 574
kadolor Avatar asked May 13 '12 20:05

kadolor


People also ask

What version of bash does Mac use?

Default Bash Version on macOS As you can see, this is GNU Bash version 3.2, which dates from 2007! This version of Bash is included in all versions of macOS, even the newest one. The reason that Apple includes such an old version of Bash in its operating system has to do with licensing.

How do I get bash shell on Mac?

The procedure is as follows: Open the terminal application. List available shells by typing cat /etc/shells . To update your account to use bash run chsh -s /bin/bash.

What is bash 3.2 Mac terminal?

That ”bash. 3.2#” is not really a code, that's the default prompt string shown for the bash command shell; for the command line. Here, that means the command line is waiting for command input.

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.


1 Answers

Homebrew is generally a bit nicer than MacPorts, as it doesn't require lots of sudo action. Here's an article that guided me to upgrading my install of bash: http://concisionandconcinnity.blogspot.com/2009/03/upgrade-bash-to-40-in-mac-os-x.html

As for steps:

  1. Install Homebrew from the docs on their homepage
  2. Install Git using Homebrew (optional, but nice to have a more up-to-date git)

    brew install git 
  3. Now install bash:

    brew install bash 
  4. Add this install of bash to the allowed shells list:

    echo '/usr/local/bin/bash' | sudo tee -a /etc/shells; 
    • Homebrew installs things to /usr/local/Cellar/ by default, then symlinks any binaries to /usr/local/bin, so you've now got the latest bash sitting at /usr/local/bin/bash
  5. Finally, change your shell to use this new one:

    chsh -s /usr/local/bin/bash 
  6. Open a new terminal window/tab, and run these commands to double-check your work:

    $ echo $SHELL /usr/local/bin/bash $ echo $BASH_VERSION 4.2.37(2)-release 
like image 73
jeffbyrnes Avatar answered Oct 07 '22 16:10

jeffbyrnes