【发布时间】:2023-03-30 03:18:02
【问题描述】:
我通过 SHC 从 linux 服务器上的 bash 脚本创建了一个二进制可执行文件。创建的二进制文件在 linux 机器上运行良好,但在 Mac 上却出错了。如何将我的 bash 文件转换为能够在任何地方运行的二进制可执行文件(ubuntu、CentOS、Mac、Cygwin)?
shc -v -r -T -f ir16fetcher.sh
mv ir16fetcher.sh.x ir16fetcher
我的 bash 脚本的 Shebang
#!/bin/bash
在 Linux 机器上
./ir16installer
USAGE : ir16fetcher <servername/ip address> [the n th latest build - optional. Default 1]
EXAMPLE: ir16fetcher jagger 2
EXAMPLE: ir16fetcher 167.116.6.155
REQUIRE: Please make sure conf file in installation folder ~/IRinstall/ir16 & ~/IRinstall/irmanager
在我的 Mac 上
./ir16installer
-bash: ./ir16installer: cannot execute binary file
【问题讨论】:
-
Linux 二进制文件无法在 Mac 上运行。在 Mac 上创建二进制文件。顺便说一句,为什么需要为 shell 脚本创建二进制文件?
-
为mac添加.command扩展名以允许执行..
标签: binary executable