{"id":17962151,"url":"https://github.com/skyzyx/bash-mac","last_synced_at":"2026-04-16T05:02:22.241Z","repository":{"id":66710369,"uuid":"99050958","full_name":"skyzyx/bash-mac","owner":"skyzyx","description":"Configuring modern Bash as the default shell for macOS","archived":false,"fork":false,"pushed_at":"2024-12-29T21:52:08.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-14T06:49:29.635Z","etag":null,"topics":["bash","mac","macos","shell","terminal"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skyzyx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-08-01T23:16:38.000Z","updated_at":"2024-12-29T21:52:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"c1797020-90cd-49c6-abc1-89645f1d1193","html_url":"https://github.com/skyzyx/bash-mac","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/skyzyx/bash-mac","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyzyx%2Fbash-mac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyzyx%2Fbash-mac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyzyx%2Fbash-mac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyzyx%2Fbash-mac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skyzyx","download_url":"https://codeload.github.com/skyzyx/bash-mac/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyzyx%2Fbash-mac/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266204640,"owners_count":23892366,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","mac","macos","shell","terminal"],"created_at":"2024-10-29T11:14:12.178Z","updated_at":"2026-04-16T05:02:17.219Z","avatar_url":"https://github.com/skyzyx.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Configuring modern Bash as the default shell for macOS\n\nThis guide uses [Upgrade to bash 4 in Mac OS X](http://clubmate.fi/upgrade-to-bash-4-in-mac-os-x/) as its base, then modifies its content over time, as appropriate. A huge thanks to [@hiljaa](https://twitter.com/hiljaa).\n\n## Install Bash\n\nBash version can be queried with the `--version` flag:\n\n```bash\n$ bash --version\nGNU bash, version 3.2.57(1)-release (x86_64-apple-darwin16)\nCopyright (C) 2007 Free Software Foundation, Inc.\n```\n\nThe actual installation is going to happen with [Homebrew](https://brew.sh), a macOS package manager.\n\n```bash\nbrew install bash\n```\n\nAfter that, grab the value from the following command. This is where Homebrew installed your new Bash binary.\n\n```bash\n$ echo $(brew --prefix bash)/bin/bash\n/usr/local/opt/bash/bin/bash\n```\n\n\u003e [!NOTE]\n\u003e The path above is correct for Intel-based Macs. If you have an Apple Silicon-based Mac, the path will be `/opt/homebrew/opt/bash/bin/bash`.\n\n## Testing the Bash version\n\nNow we'll want to test our version of Bash. Imagine a file:\n\n```bash\n#! /bin/bash\n# version-test.sh\necho $BASH_VERSION;\n```\n\nMake it executable and run it:\n\n```bash\n$ chmod +x ./version-test.sh\n$ ./version-test.sh\n3.2.57(1)-release (x86_64-apple-darwin16)\n```\n\nSeemingly it’s still using the old version of Bash. The trick is the _shebang_ on the first line, it’s pointing to the old Bash path. Change it to use the new path that you saved, above.\n\n### Intel Mac\n\n```bash\n#! /usr/local/opt/bash/bin/bash\n# version-test.sh\necho $BASH_VERSION;\n```\n\n### Apple Silicon Mac\n\n```bash\n#! /opt/homebrew/opt/bash/bin/bash\n# version-test.sh\necho $BASH_VERSION;\n```\n\n### Check the version\n\nNow run it and it gives a newer version.\n\n```bash\n$ ./version-test.sh\n5.2.21(1)-release\n```\n\n## Configure the Default Shell in Terminal\n\nAgain, use the new path that you saved above.\n\n```bash\nsudo bash -c \"echo $(brew --prefix bash)/bin/bash \u003e\u003e /etc/shells\"\nchsh -s $(brew --prefix bash)/bin/bash\n```\n\nNow quit Terminal, then re-launch it.\n\n```bash\necho $BASH_VERSION;\n```\n\n## Troubleshooting\n\nIf it still shows the old Bash, just go to the _Terminal_ menu → _Preferences_ → _General_ → _Shells open with_, then choose _Default login shell_.\n\n## See Also…\n\n* https://superuser.com/questions/857250/how-to-update-bash-on-mac-os-x-yosemite\n* http://clubmate.fi/upgrade-to-bash-4-in-mac-os-x/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyzyx%2Fbash-mac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskyzyx%2Fbash-mac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyzyx%2Fbash-mac/lists"}