在 shell 找不到脚本命令中发现错误,我该如何解决?

Found error in shell script command not found,How can I resolve it?

我遇到了这些错误:意外标记 `$'\r''$'\r' 附近的语法错误:命令未找到 我在云 shell(https://ssh.cloud.google.com/cloudshell/)

上使用 windows 10 和记事本++编辑器 运行

错误--> 第 1 行:$' :\r': 找不到命令

-->解决用notepad++打开这个文件然后右下角有Windows(CLRF)选项右击更改到 Unix(LF) 然后是 运行 代码。

这是 windows10

除了在 notepad++ 中执行此操作之外,您还可以直接在 unix 上的 shell 脚本上 运行 dos2unix