2

我不确定我做了什么弄乱了我的 zsh 配置,但是每次我尝试运行 zsh 时,我都会收到以下消息,然后是默认主题:

/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

1 回答 1

4

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

于 2012-07-13T18:10:40.500 回答