The error message:
command not found: ^M
Happened to me due to my file having the wrong type of carriage returns in my zshrc.config file. Once I changed myย line endings to ‘\n’ instead of the Windows CRLF line endings the error messages went away ๐
You can check if a file is using CRLF or LF by using the ‘file‘ command in linux.
$ file what\ lol.txt what lol.txt: ASCII text, with CRLF line terminators
Error message being fixed: