zhyuzh3d

关注

【linux基础】解决shell错误:syntax error: unexpected end of file

zhyuzh3d

关注

阅读 132

2022-07-13

 

在Linux下运行shell脚本,报错

syntax error: unexpected end of file

使用vim打开脚本,执行命令:

:set fileformat=unix

保存退出就可以了。问题解决。

 

原因是Linux下的文件结束符和Windows下的文件结束符不一样。

在Windows上编辑的脚本,放在Linux系统上运行就会有这种问题。

相关推荐

以前干嘛去了

shell syntax error: unexpected end of file

以前干嘛去了 65 0 0

产品喵dandan米娜

【shell】真正解决syntax error:unexpected end of file?

产品喵dandan米娜 140 0 0

棒锤_45f2

<?php}?>格式导致错误 Parse error: syntax error, unexpected end of file in *.php on line 374

棒锤_45f2 65 0 0

独兜曲

执行shell脚本报错:Syntax error “(” unexpected

独兜曲 51 0 0

小禹说财

Error_Unix Shell_syntax error near unexpected token `fi'

小禹说财 53 0 0

余寿

syntax error near unexpected token

余寿 65 0 0

流沙雨帘

ubuntu下执行shell脚本报错 Syntax error: “(“ unexpected

流沙雨帘 42 0 0

飞鸟不急

Syntax Error: Unexpected token (1:1721)

飞鸟不急 68 0 0

十里一走马

syntax error near unexpected token `do

十里一走马 59 0 0

boom莎卡拉卡

Invocation failed Unexpected end of file from server

boom莎卡拉卡 105 0 0

精彩评论(0)

0 0 举报