无法`source` shc 编译的脚本 [英] Cannot `source` shc-compiled scripts

查看:27
本文介绍了无法`source` shc 编译的脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法source(包含)编译好的脚本?

Is there any way to source (include) compiled script?

我使用 shc 来编译我的所有脚本以及运行它们时从命令行开始,他们可以正常工作.但是当脚本必须包含其他两个脚本(variables.sh.xfunctions.sh.x)时,它会崩溃并返回错误,即不能包含二进制文件.

I use shc to compile all of my scripts and when I run them from the command line they work OK to start. But when script have to include other two scripts (variables.sh.x and functions.sh.x) it crashes and returns an error, that binary files can not be included.

有没有办法做到这一点?

Is there any way to accomplish this?

包括一段代码:

source $(dirname $0)/variables.sh.x
source $(dirname $0)/functions.sh.x

推荐答案

shc 实际上并不编译脚本.它只是通过在 C 程序中加密和嵌入它们来混淆它们,因此它不能提高性能.实际的 shell 仍然解释和执行代码,并且是脚本运行所必需的.

shc does not actually compile scripts. It merely obfuscates them by encrypting and embedding them inside a C program, so it cannot improve performance. The actual shell still interprets and executes the code and is required for the script to run.

如果您绝对必须使用此工具来混淆您的代码,则必须将所有内容合并到一个文件中.

If you absolutely must use this tool to obfuscate your code, you will have to combine everything into a single file.

这篇关于无法`source` shc 编译的脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆