Tiny Core Extensions > TCE Q&A Forum

How to install SHC (shell script compiler)

(1/2) > >>

malikawan:
I have compile shc with out any error  :D but when i convert my shell script with shc to binary it gives me error xxx.sh.x: applet not found  :-[
Please any idea about that.

Thanks
Regards
Malik Awan

Juanito:
what does "ldd yourshellscriptbinary" give?

Rich:
Hi malikawan

--- Quote from: malikawan on October 10, 2017, 02:47:13 AM --- ... it gives me error xxx.sh.x: applet not found ...
--- End quote ---
You're not clear if the error occurs while converting your script or if it occurs when running the executable that was created.

sch  requires a compiler in order to run, so  compiletc.tcz  should be installed.

The output from  shc  is not an independent binary. It still relies on the shell scripting language specified on the first line
of your script. So if the first line of your script reads:

--- Code: ---#!/bin/bash
--- End code ---
then your executable will expect to find  /bin/bash.

polikuo:
I believe it's a busybox issue.
In the C code it generated:


--- Code: ---.....

#define BUSYBOXON 0 /* Define as 1 to enable work with busybox */

.....

#if BUSYBOXON
varg[j++] = "busybox";
varg[j++] = "sh";
#else
varg[j++] = argv[0]; /* My own name at execution */
#endif

.....

--- End code ---

You'll need to enable busybox.


--- Code: ---tc@box:/tmp/hello$ shc -B -f hello.sh -o hello
tc@box:/tmp/hello$ ./hello
Hello world!

--- End code ---

I don't really see the benefit of it though, the binaries are bigger than their original source scripts.  :o

Rich:
Hi polikuo

--- Quote ---I don't really see the benefit of it though, the binaries are bigger than their original source scripts.
--- End quote ---

From what I could tell, it lets you hide a scripts contents and prevent modification. Aside from larger binaries, they would not
run any faster since they are still being passed through the shell interpreter.

Navigation

[0] Message Index

[#] Next page

Go to full version