openWRT 交叉编译程序 ./hello: line 1: syntax error: unexpected "(" 可执行程序无法在Linux上运行,显示line 1: syn...
linux \u8fd0\u884c\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u51fa\u73b0 line 1: syntax error: unexpected "(" \u7684\u9519\u8bef\u51fa\u73b0 line 1: syntax error: unexpected "(" \u7684\u9519\u8bef\u8bf4\u660e\u53ef\u6267\u884c\u811a\u672c\u51fa\u73b0\u5f02\u5e38\uff0c\u5177\u4f53\u9519\u8bef\u5728\u811a\u672c\u7684\u7b2c\u4e00\u884c\uff0c\u662f\u8bed\u6cd5\u9519\u8bef\uff0c\u201c(\u201d\u4e0d\u662f\u9884\u671f\u7684\u3002
\u9898\u4e3b\u9700\u8981\u68c0\u67e5\u811a\u672c\u4e2d\u7684\u5b9e\u9645\u5185\u5bb9\uff0c\u6839\u636e\u5177\u4f53\u5185\u5bb9\u53bb\u6392\u9664\u95ee\u9898\uff0c\u811a\u672c\u624d\u80fd\u6b63\u786e\u6267\u884c\u3002
\u6269\u5c55\u8d44\u6599
linux\u4e0bshell\u811a\u672c\u7684\u57fa\u672c\u8bed\u6cd5\u7ed3\u6784\u4ecb\u7ecd\uff1a
shell\u811a\u672c\u5f00\u5934\u4ee5#! /bin/bash\u8868\u793a\u8bf4\u660e\u8fd9\u662f\u4e00\u4e2ashell\u811a\u672c
\u811a\u672c\u6587\u4ef6\u7684\u540d\u5b57\u662f\u4ee5.sh\u7ed3\u5c3e\u7684\uff0c\u7528\u4e8e\u533a\u5206\u8fd9\u662f\u4e00\u4e2ashell\u811a\u672c\u6587\u4ef6
shell\u6267\u884c\u65b9\u6cd5\u6709\u4e24\u79cd\uff0c\u4e00\u79cd\u662f\u7ed9\u4e88\u6743\u9650\uff0c\u4f7f\u7528sh shell.sh\u6216./shell.sh\u7684\u65b9\u5f0f\uff0c\u4e00\u79cd\u662fbash shell.sh\u7684\u65b9\u5f0f
\u67e5\u770b\u811a\u672c\u6267\u884c\u8fc7\u7a0b -x
[root@localhost src]# sh -x 1.sh + echo 123
123
exit
\u67e5\u770b\u811a\u672c\u8bed\u6cd5\u662f\u5426\u6709\u9519\u8bef -n
[root@localhost src]# sh -n 1.sh 1.sh: line 5: syntax error: unexpected end of file
\u5e94\u8be5\u7528\u9759\u6001\u7f16\u8bd1\uff0c\u6211\u4e5f\u9047\u5230\u4e86\u8fd9\u6837\u7684\u95ee\u9898\uff0c\u73b0\u5728\u5df2\u7ecf\u89e3\u51b3\u4e86\u3002
arm-linux-gcc-static hello.c -o hello \u628a\u751f\u6210\u7684hello\u53ef\u6267\u884c\u6587\u4ef6\u4f20\u5230arm\u677f\u4e0a\u5c31\u884c\u4e86\uff0c\u7528\u7684\u65f6\u5019\u9700\u8981\u4fee\u6539\u4e00\u4e0b\u6743\u9650\u3002chmod 777 hello\u5c31\u53ef\u4ee5\u6267\u884c\u4e86
扩展阅读:openwrt软件包列表 ... openwrt 端口转发 无效 ... openwrt 无线未关联 ... openwrt 修改端口号 ... openwrt 命令行 重置 ... 软路由openwrt官网 ... openwrt opkg ... openwrt nas ... openwrt ssr服务 未运行 ...