bash脚本错误 Syntax error: else unexpected (expecting then)解决 发表于 2019-03-06 分类于 踩坑笔记 本文字数: 83 阅读时长 ≈ 1 分钟 今天在使用 bash 脚本发布程序时,发生了这样的错误 1xxx.sh: Syntax error: "else" unexpected (expecting "then") 到处搜索资料尝试无果之后想到会不会是编码问题导致,dos2unix 处理后测试果然可以 1sudo apt-get -y install dos2unix 处理 12dos2unix xxx.shdos2unix: converting file xxx.sh to Unix format ...