Starting with macOS Catalina, your Mac uses zsh as the default login shell and interactive shell. However, I have years of stuff aliases, function and scripts done in bash. So here is how to set and use bash as the default shell.
How do I use foreach loop in bash shell running on Linux? You can’t but you can use either while or for loop to as identical to csh/tcsh foreach loop.