Doesn't work for me on MacOS:
I get "mapfile: command not found"
IIRC macOS is at least one major version behind in bash.
something something licensing something something
new installs default to bash not being the default terminal. someone else mentioned macports, but there's a new version available via brew as well
So far I have resisted the change. All the people I know who think zsh is great have a fairly large number of addons to get it that way.
This first time I used a mac where zsh was the default, I was confused for quite a bit of time when it would not run something I was used to doing. I kept looking up errors on the internet until I came across someone's post with a reply asking if they were using Terminal on a new OS X. Sure enough, this was a new mac as well. Now I know one of the first steps for me with a new Mac is change default shell. I'm way too old and set in my ways to care to learn a new shell. Choosing a shell, IDE, font, etc are games for youth.
I learned to consistently use shebangs at the top of scripts while working with the first zsh user I knew. Or might have been fish. No i think he started in zsh and moved to fish. Every time I forgot, his environment was busted. And he sat a cubicle and a half away from me, so I got fast feedback.