shell - 脚本常见异常

syntax error unexpected end of file

# 检测语法
sh -n [filesName] 

# 报错,这个报错很容易触发,同时,也很容易解决
syntax error unexpected end of file


原因:
1、换行符问题,windows 系统和 linux 换行符是不一样的,windows 系统多了 '\r',这种情况下,空行的位置还会报错:“\r:command not found”;
2、语法错误,调用方法加了括号;
3、……

后续有其它内容继续补充
…………

posted on 2024-06-20 10:04  疯狂的妞妞  阅读(4)  评论(0编辑  收藏  举报

导航