执行shell脚本报错:syntax error near unexpected token `或syntax error: unexpected end of file
引起此问题最可能的原因是:在windows下编写的文件上传到linux执行。我是在notepad++上编写的代码,之后上传到linux执行,报此错误。仔细检查,语法方面没有错误。上网查了一下,发现是windows和linux的换行不同导致的。windows中是回车+换行CRLF;linux下是就一个...
解决执行脚本报syntax error: unexpected end of file或syntax error near unexpected token `fi'错误的问题
1.我们在编辑Linux服务器上的文件时,如果直接在Linux环境下编辑的话,比较麻烦,大段粘贴格式比较乱,还得自己一行一行去调整,因此会选择用编辑器来编辑我们Linux环境下的文件,我用的是NodePad++,大家可以参考http://blog.csdn.net/u012453843/articl...
解决执行脚本报syntax error: unexpected end of file或syntax error near unexpected token `fi'错误的问题
解决执行脚本报syntax error: unexpected end of file或syntax error near unexpected token `fi'错误的问题 我们在编辑Linux服务器上的文件时,如果直接在Linux环境下编辑的话,比较麻烦,大段粘贴格式比较乱,还得自...
解决执行脚本报syntax error: unexpected end of file或syntax error near unexpected token `fi'错误的问题
直接输入":",然后在":"之后输入"set ff"如下图所示 我们需要把格式改为unix,方法是输入":set ff=unix",也可以输入":set fileformat=unix"如下图所示。
解决执行脚本报syntax error: unexpected end of file或syntax error near unexpected token `fi'错误的问题
我们在编辑Linux服务器上的文件时,如果直接在Linux环境下编辑的话,比较麻烦,大段粘贴格式比较乱,还得自己一行一行去调整,因此会选择用编辑器来编辑我们Linux环境下的文件,我用的是NodePad++,大家可以参考http://blog.csdn.net/u012453843/artic...