Its not part of the usual distribution, so you'll need to have this installed via the package manager or via the terminal using apt-get:
sudo apt-get install shc
After which, simple call the function using this format: shc -f
Example: shc -f mydownloads.sh
What shc does is translate your script into C, then compile it and make it executable. If we ran the example this will result in two-(2) additional files: source and executable
Example:
-rw-r--r-- 1 me me 354 2009-04-25 13:11 mydownloads.sh
-rwx--x--x 1 me me 10948 2009-04-25 13:11 mydownloads.sh.x
-rw-r--r-- 1 me me 11299 2009-04-25 13:11 mydownloads.sh.x.c
The file mydownloads.sh.x is automatically set as executable. Make sure to test it and compare the results with the original script. In my tests you can even ranema the file to something else more descriptive.
But what if in your changing and sharing the executable bit gets unset? Well, that is simple. Just run chmod.
sudo chmod +x
No comments:
Post a Comment