When I enter brew doctor (or any brew command) in my terminal, I get this as a response:
brew doctor
brew
-bash: /usr/local/bin/brew: /bin/sh
This worked for me:
vi /usr/local/bin/brew
:set fileformat=unix
:wq!
The brew command should be OK now.
Regards.