I have patched bash & sh with the latest patches as described here, but now have some issues with some things in my dotfiles (particularly the loading of rvm and some custom functions and completions).
I don't have the issues if I just use the brew version of bash as both /bin/bash
and /bin/sh
, but I'm wondering if I might run into other problems with system stuff.
Best Answer
I would advise against making the Homebrew installation of bash your system-wide
bash
orsh
command. However it should be fine to use as your personal shell.Homebrew provides a vanilla installation of Gnu Bash. You will be missing any Apple additions to the shell that are provided if you use the Apple-supplied
bash
orsh
binaries or source code from Apple's opensource.apple.com site. Any OS-level shell script provided by Apple may be relying on those Apple extension and changes to function.Homebrew also installs, by default, a 4.3.x version of bash:
This is a significantly different version than the 3.2.x version that ships with OS X 10.9.x. It is not 100% backwards compatible with pre 4 versions. For example substring extraction on positional parameters indexing changed from 3 to 4. It could break system-level scripts.
Both of those reasons can lead to inoperable system scripts on your Mac if you switch to Homebrew's versions of
bash
andsh
for anything other than your personal shell. You can make your personal shell the Homebrewbash
shell by running:and then logging out and logging back in. This should be relatively safe for the stable operation of your machine.
If the above
chsh
command fails saying/usr/local/bin/bash
is not an acceptable shell you'll need to add it to the list in/etc/shells
by running:It should be added on a new line in the file like so: