sudo apt install shc
Compile script file using shc
shc -f hello.sh
Check generated files
ls -l hello* -rw-rw-r-- 1 user user 29 Mar 14 07:37 hello.sh -rwxrwxr-x 1 user user 14960 Mar 14 07:39 hello.sh.x -rw-rw-r-- 1 user user 10047 Mar 14 07:39 hello.sh.x.c
.sh
is the original script.
sh.x
is the compiled binary.
.sh.x.c
is the C source code generated from the .sh
file prior to compiling to .sh.x
.
hello.sh.x
permission is automatically set as executable
Rename executable
mv hello.sh.x hello
Check file execution
./hello Alice