Upgrade bash without using the terminal to fix iterm issue dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib Question

How can I upgrade bash or otherwise get a CLI to work?

Error

dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib
  Referenced from: /usr/local/bin/bash
  Reason: image not found


Background

Out of nowhere iTerm stopped working. 



I uninstalled then reinstalled the latest version. Still getting this error



Then i tried the default Terminal mac app. Now seeing this in there



I have been searching similar problems and they seem to all give instructions on how to update BREW or bash. 

https://github.com/Homebrew/homebrew-core/issues/5799

https://gist.github.com/samnang/1759336

But the instructions are with the CLI, which i cannot access



Update 1

I changed the path per a suggestion in the comments. Now Terminal app works but iTerm still has a "broken pipe"
This was what helped me, there may be more &quot;correct&quot; ways but if you just need to get it working, give it a go.
Step 1
Open the default Terminal app, then click on Preferences

You will see a path for &quot;Shells open with&quot;

Change the path to
/bin/bash

Close everything out and restart Terminal. Now it should be working, if not, sorry you might have an additional problem that I did not have. But proceed if you are good at this point.
Step 2
proceed to now update bash
brew install bash


Because I ran install I also had to unlink
brew unlink bash


then I ran the command again to install
brew install bash


At this point i started iTerm up again with no problem