Compile Bash Script into Binary in Linux

sudo apt install shc

Compile script file using shc

shc -f

Check generated files

ls -l hello*
-rw-rw-r-- 1 user user    29 Mar 14 07:37
-rwxrwxr-x 1 user user 14960 Mar 14 07:39
-rw-rw-r-- 1 user user 10047 Mar 14 07:39

.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. permission is automatically set as executable

Rename executable

mv hello

Check file execution

./hello Alice