Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot `source` shc-compiled scripts

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

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?

including piece of code:

source $(dirname $0)/variables.sh.x
source $(dirname $0)/functions.sh.x
like image 580
Clem Avatar asked Aug 22 '26 06:08

Clem


1 Answers

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.

like image 113
PleaseStand Avatar answered Aug 25 '26 09:08

PleaseStand



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!