How to use bash version 4 or 5 on XCode 10.2 image

Our builds are using the macos: xcode: 10.2.1 image. The /bin/bash --version there is 3.2.57. Is there a way to upgrade the shell to bash 5 so I can use Bash’s built-in uppercase string conversion of

echo "${a^^}"

in my script? I have the same bash commands running fine on my Android side which is image circleci/android:api-28-node using Bash 5.0.3.
But on the iOS side, with xcode 10.2.1 image I get a “bad substitution” error.

Hi Terri,

I had a go at this today, and I got some good results:

This is the config that does the necessary:

version: 2.1
      xcode: 11.0.0

    # Use Bash installed from Homebrew as the default shell
    shell: /usr/local/bin/bash --login -eo pipefail

      - checkout

      - run:
          name: Install bash 5 using the system bash
          shell: /bin/bash -eo pipefail # Use the system bash for this step.
          command: brew install bash
            HOMEBREW_NO_AUTO_UPDATE: 1 # This is faster

      # Now all steps use the new bash:
      - run: bash -version # Show bash version
      - run: echo $0       # Show current shell

And there is information about shell options here: