Shell script compile
From time to time we may need independence in the system on which we run a script. Or simply we do not want that the users of the system of destiny, see the code of some script of shell , for the reason that is. For these cases, we can make use of a tool that allows to compile them. In this way, we will have a binary ELF , that we will be able to port to where we need.
Suppose then that we have:
And we want to convert it to ELF. To do this we simply use shc together with the -f parameter to compile it.:
As we can see, we can directly execute our already compiled file, shc automatically assigns it execution privileges:
We can now take our executable to other systems!