build.sh 出现bash: $'\r': command not found

2024-10-15 12:53:08

1、问题表述:在Windows下编写好sh文件后,在Linux下运行会报错:bash: $’\r’: command not found

build.sh 出现bash: $'\r': command not found

3、解决方案一:通过vim编辑直接删除^M后保存就行,但是如果文档的内容比较长就悲剧了

build.sh 出现bash: $'\r': command not foundbuild.sh 出现bash: $'\r': command not found

5、总结:1. 问题陈述2. 发现问题原因3. 提供解决方案

猜你喜欢