Change bash without making it default shell Mac

Use the following shebang in your scripts:

#!/bin/env bash

This makes them use the first bash in the PATH; which is the one you want.

This solution works with any Bash on any UNIX-like system.


use your new bash path: ex, if new bash is in /usr/local/bin/

/usr/local/bin/bash my-cool-bash.sh

or write first line of script:

#!/usr/local/bin/bash