shell bash macos add tag
5 years ago PeterVandivier

The default macOS install of bash is 3.2. brew install bash currently installs bash 5. How do you install bash 4?

Top Answer
5 years ago James Douglas
  1. Find the bash formula commit history: https://github.com/Homebrew/homebrew-core/commits/master/Formula/bash.rb

  2. Find the latest commit that uses bash 4, for example: bash: update 4.4.23 bottle. and click “Browse files”

  3. Navigate to Formula/bash.rb, and click “Raw”

  4. Copy the URL, and run brew install <url> so for example:

And that should install bash version 4.4.


Based off answer to SO question Homebrew install specific version of formula?

5 years
PeterVandivier — Thursday, 27th Feb 2020 11:34

the homebrew repo is a bit chonky for the GitHub web interface, so if you want a specific version, i’ve taken the liberty of extracting the bash.rb history here - https://gist.github.com/petervandivier/258150254a9ca9372eedd75c31ec759f

24 minutes
PeterVandivier — Thursday, 27th Feb 2020 11:10

i was actually on that SO thread this morning, but i only read the top 3 answers or so 😛 😆

PeterVandivier — Thursday, 27th Feb 2020 11:06
3 hours

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.