MacOS Catalina Homebrew UPDATE Error: Unknown command: doctor’

I’m on a MAC (macOS Catalina). I’m running ohmyzsh, and it keeps trying to update homebrew everytime I start terminal. I get this error:

Error: Unknown command: doctor’

Can anyone tell me how to fix this?

If you pasted the error message correctly, it seems ohmyzsh is trying to run brew doctor':

$ brew "doctor'"
Error: Unknown command: doctor'

If that’s correct, get ohmyzsh to stop (no clue on ohmyzsh, ask their authors — this seems a bug). If anything, they should call brew doctor, without the extra quote.

@jvkrakowski, also check the output of:

grep -r "doctor'" "${ZDOTDIR:-$HOME}"/.zsh* /etc/zsh*

I ran the command, and this is what I got:

/Users/jvkrakowski/.zsh_history:: 1600044746:0;grep -r " **doctor'** " "${ZDOTDIR:-$HOME}"/.zsh* /etc/zsh*
/Users/jvkrakowski/.zsh_history:: 1600044895:0;grep -r " **doctor'** " "${ZDOTDIR:-$HOME}"/.zsh* /etc/zsh*
/Users/jvkrakowski/.zsh_history:: 1600044986:0;grep -r " **doctor'** " "${ZDOTDIR:-$HOME}"/.zsh* /etc/zsh*

Any idea how to fix this?

.zsh_history is just a history file that records all the commands you type, so there’s nothing to fix there.

However, if you actually ran:

grep -r " **doctor'** " "${ZDOTDIR:-$HOME}"/.zsh* /etc/zsh*

you need to copy and paste the exact command I typed previously.