Terminal and iTerm not working after upgrading to macOS Sierra After I updated to macOS Sierra, Terminal.app and iTerm failed with the same error:

login: /usr/local/bin/bash: No such file or directory


Now I can fix Terminal with this. But then in Terminal:

mkdir: /Users/username/.bash_sessions: Operation not permitted


Also, this does not fix iTerm. So where does this /usr/local/bin/bash come from, why is it missing, and if Sierra deleted it, why isn't the new Terminal updated?

There's a guy with the same problem as mine. So I'm not alone.
Open System Preferences > Users &amp; Groups.
Unlock the padlock at the bottom of the preference pane
Hold down the option key and click your account then click the Advanced Options... menu
Change your shell to /bin/bash
Click the OK button and close the preference pane.
Logout then log back in