200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > LINUX下运行.sh文件出现Syntax error: end of file unexpected (expecting “then”)最方便解决方法

LINUX下运行.sh文件出现Syntax error: end of file unexpected (expecting “then”)最方便解决方法

时间:2021-07-04 20:07:25

相关推荐

LINUX下运行.sh文件出现Syntax error: end of file unexpected (expecting “then”)最方便解决方法

此问题在StackOverFlow的链接

出现问题的原因是.sh文件是dos格式文件,但是linux的shell需要unix格式的文件,因此需要进行转换

$ sudo apt-get install dos2unix$ dos2unix <filename>

即可。

下图为成功转换后的截图:

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。