Homebrew/homebrew — pull request #32989 by jpmx (2014-10-07 04:19:30+00:00)
Title: Update brew to use `#!/usr/bin/env bash`

Latest (recently patched) bash version isn't compatible with OS X's default bash ( /bin/sh = /bin/bash on OS X )

Run this with latest bash (v4.3.30) and unpatched version of OS X's bash:
```sh
hello() { echo Hello; }
export -f hello
brew --version
/bin/sh: line 2: `BASH_FUNC_hello%%': not a valid identifier
```

Running a command through `/usr/bin/env` has the benefit of looking for whatever the default version of the program is in your current environment