linux - 我可以在 Linux 中混合文本和二进制文件吗?

标签 linux bash unix fedora

我想简化该应用程序在 Linux 系统上的安装,使其成为一键式安装。为此,我希望将 bash 脚本与压缩的 tar 相结合。

所以我有 install.shsome_app.tar.gz 文件。

然后我有一个执行此操作的 Ant 任务:

cat install.sh some_app.tar.gz > some_app.exe

简而言之,文件读取自身、解压缩 tarball 并提取文件并更改权限。

当我单独运行 install.sh 时它工作正常,但是一旦我运行 some_app.exe 它就会失败并出现以下错误:

/some_app.exe: line 4: Binary file (standard input) matches + 1: arithmetic syntax error

所以我想知道文本是否可以与二进制结合?

最佳答案

关于linux - 我可以在 Linux 中混合文本和二进制文件吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6232274/

相关文章:

linux - 如何禁用 yocto 中的某些键盘键

c++ - Linux:fork & execv,等待子进程挂起

bash - 为什么 wget 从 PyCharm 的终端运行时以俄语打印所有消息?

linux - 根据第一列的开头合并 txt 中的几行

linux - 如何在 unix 脚本中发送带有消息的邮件

linux - 内核如何设置注册cr3?

linux - 如何读取 CGI Bash 脚本中的 HTTP header 值

bash - 多行输出到带分隔符字符串的单行连接

git - 如何切换到 "Use Git from command prompt?"

bash - unix 中的自定义脚本输出