syntax error: unexpected end of file

简介: syntax error: unexpected end of file

运行工程报错误:`liporepo.sh: line 2:

       command not found

       liporepo.sh: line 19: syntax error: unexpected end of file

       Command PhaseScriptExecution failed with a nonzero exit code

        `

        由于.sh文件的格式为dos格式。而linux只能执行格式为unix格式的脚本。因为在dos/window下               按一次回车键实际上输入的是“回车(CR)”和“换行(LF)”,而Linux/unix下按一次回车键只输入    “换行(LF)”,所以修改的sh文件在每行都会多了一个CR,所以Linux下运行时就会报错找不到命令。

我们可以查看该脚本文件的格式,方法是使用命令:vim liporepo.sh进入编辑文件界面,如下图所示。

直接输入":“,然后在”:"之后输入"set ff"如下图所示

回车即可看到脚本格式,如下图所示,可以看到当前脚本格式是dos。

我们需要把格式改为unix,方法是输入":set ff=unix",也可以输入":set fileformat=unix"如下图所示。

输入完之后,回车即可完成切换格式。然后我们再输入":set ff"来查看格式,如下图所示,可以看到当前脚本格式变成了我们想要的"unix"了。

输入:wq并回车,保存并退出编辑状态。

这个是把SDK工程生成的库文件拷贝到当前目录。分析为何文件格式会从uinx格式变成doc格式,很可能是用其他工具编辑过,默认保存为doc格式文件了。


目录
相关文章
|
24天前
Showing Recent Messages Command CodeSign failed with a nonzero exit code
Showing Recent Messages Command CodeSign failed with a nonzero exit code
18 0
|
8月前
|
SQL Java 数据库连接
sql injection violation, syntax error: syntax error, error in :‘**‘expect IDENTIFIER, actual IDENTIF
sql injection violation, syntax error: syntax error, error in :‘**‘expect IDENTIFIER, actual IDENTIF
137 0
|
1月前
|
Perl
报错:error Parsing error: x-invalid-end-tag
报错:error Parsing error: x-invalid-end-tag
|
11月前
error C2449: found ‘{‘ at file scope (missing function header?)和error C2059: syntax error : ‘}‘
error C2449: found ‘{‘ at file scope (missing function header?)和error C2059: syntax error : ‘}‘
76 0
|
9月前
Uniapp Syntax Error: Error: Unbalanced delimiter found in string
Uniapp Syntax Error: Error: Unbalanced delimiter found in string
134 0
|
12月前
|
关系型数据库 MySQL C++
Error:fatal error C1010: unexpected end of file while looking for precompiled head
Error:fatal error C1010: unexpected end of file while looking for precompiled head
90 0
|
12月前
error C2041: illegal digit ‘9‘ for base ‘8‘ | error C2059: syntax error: ‘bad suffix on number‘
error C2041: illegal digit ‘9‘ for base ‘8‘ | error C2059: syntax error: ‘bad suffix on number‘
106 0
|
12月前
|
关系型数据库 MySQL C++
Error:error C2601: ‘b‘ : local function definitions are illegal error C2063: ‘b‘ : not a function
Error:error C2601: ‘b‘ : local function definitions are illegal error C2063: ‘b‘ : not a function
131 0
Parse error: syntax error, unexpected '<<' (T_SL) in .../test2.php on line 2
Parse error: syntax error, unexpected '<<' (T_SL) in .../test2.php on line 2
111 0
syntax error, expect {, actual [, pos 0 at
syntax error, expect {, actual [, pos 0 at
155 0