2

I'm not sure what I did to mess up my zsh configuration but every time I try to run zsh I get the following message followed by the default theme:

/Users/danny/.zshrc:3: command not found: ^M
/Users/danny/.zshrc:9: command not found: ^M
/Users/danny/.zshrc:13: command not found: ^M
/Users/danny/.zshrc:16: command not found: ^M
/Users/danny/.zshrc:19: command not found: ^M
/Users/danny/.zshrc:22: command not found: ^M
/Users/danny/.zshrc:25: command not found: ^M
/Users/danny/.zshrc:28: command not found: ^M
/Users/danny/.zshrc:32: command not found: ^M
/Users/danny/.zshrc:33: command not found: ^M
/Users/danny/.zshrc:source:34: no such file or directory: /Users/danny/.oh-my-zsh^M/oh-my-zsh.sh^M
/Users/danny/.zshrc:35: command not found: ^M
danny%

I've tried removing .zshrc and .oh-my-zsh and reinstalling oh-my-zsh via brew but I continue to have the same issue. How can I resolve this?

Danny Garcia
  • 831
  • 2
  • 8
  • 24

1 Answers1

4

Because CR isn't considered a newline, only LF. Use dos2unix on your file, and only edit it with a text editor that can tell the difference.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
  • Ok great, this seems to solve the issue for ~/.zshrc but now I'm seeing it in ~/.oh-my-zsh/oh-my-zsh.sh and other places. Is there a global setting somewhere that is reading everything in the wrong format? – Danny Garcia Jul 13 '12 at 18:16
  • @DannyGarcia I belive there are no. But where did you get oh-my-zsh? Maybe this is your VCS misconfiguration that led to such problems. – ZyX Jul 13 '12 at 19:26
  • @ZyX perhaps, I was just doing `brew install zsh` - I think. – Danny Garcia Jul 17 '12 at 00:12