2012-07-13 138 views
1

我不知道我做了什么搞糟我的zsh配置,但每一次我尝试运行的zsh我碰到下面的信息,然后默认主题时间:为什么zsh在〜/ .zshrc中读取新行(^ M)作为命令?

/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% 

我试图消除.zshrc和.oh-my-zsh并通过brew重新安装oh-my-zsh,但我仍然遇到同样的问题。我该如何解决这个问题?

回答

4

因为CR不被视为新行,所以只有LF。在您的文件上使用dos2unix,并且只能使用文本编辑器对其进行编辑,以便区分它们。

+0

好了,这似乎解决了〜/ .zshrc的问题,但现在我在〜/ .oh-my-zsh/oh-my-zsh.sh和其他地方看到它。是否有一个全球设置的地方正在读取格式错误的所有内容? – 2012-07-13 18:16:25

+0

@DannyGarcia我相信没有。但是你从哪里得到了哦-my-zsh?也许这是您导致此类问题的VCS配置错误。 – ZyX 2012-07-13 19:26:46

+0

@ZYX也许,我只是在做'brew install zsh' - 我想。 – 2012-07-17 00:12:51

相关问题