I have installed bash 4 with Homebrew and
bash --version shows me the version 4.
If I have following test script:
#!/usr/local/bin/bash # test-version.sh echo $BASH_VERSION
And I make it executable
chmod +x configurer.sh and run it
./test-version.sh I also get the version 4.
But if I run it with the
sh test-version.sh I get the version 3.
I have put the new shell into
sudo bash -c 'echo /usr/local/bin/bash >> /etc/shells'
And changed to the new shell:
chsh -s /usr/local/bin/bash
I also changed the path in iTerm Settings > Profiles > Command to
EDIT: I've come to realize that it's good to leave
sh alone. When wanting to run scripts with Bash 4 just don't use