Bash syntax error: unexpected end of file
今天在处理一个shell脚本的时候,遇到了 syntax error: unexpected end of file,费了半天劲才发现脚本是在Windows下编辑的,罪魁祸首 CRLF。
用dos2unix
命令处理脚本:
# install dos2unix
→ ~ $ sudo apt-get install dos2unix
# convert file
→ ~ $ dos2unix filename.sh
Copyright © 2016-2024 by 赵军旺