Your shell script should start with the line:
#!//bash
Which should point to the installed bash you want. Since you seem to be contend with the bash that was found by executing bash --version
, you can execute which bash
to tell you where that one is.
Alternately, you can start your script with:
#!/usr/bin/env bash
Which will use the bash that is found on your PATH.