Linux提示Syntax error: end of file unexpected (expecting "then") 提示错误

shell命令在windows下编辑过后出现Syntax error: end of file unexpected (expecting "then") 提示错误

  

这是因为我在windows下些的脚本,windows和linux的回车换行时不一样的字符,所以脚本在解释时会出现问题。

在windows里,换行用的两个符号,回车换 行符号 ,在linux下只需一个符号 就可以了. 

sed -i 's/
$//' autoconf.sh

 

通过命令把换行符转换一下就可以了.

原文地址:https://www.cnblogs.com/cqwo/p/14233905.html