In this video, we'll be discussing the process of turning a shell script, which is a text-based program, into a standalone executable binary file that can be easily run on any system. This is a valuable skill for those who want to distribute their shell scripts or improve the performance and security of their programs. So, let's get started!"
If you've written a shell script and want to hide the source code and prevent future modifications, the shell script compiler or shc command might be your best bet.
Here's an example of using shc to compile a shell script:
To keep things simple, let's write a shell script that prints the phrase "Hello Lazy".
#!/bin/sh
echo "Hello Lazy"
Compile the script using shc:
shc -v -f hello.sh
This will create two extra files.
hello.sh is the original unconverted shell script
hello.sh.x is the converted shell script in binary format
and hello.sh.x.c is the C source code of the hello.sh file. This C source code is compiled to create the above converted hello.sh.x file.
Now, let us execute the converted shell script. You can run the binary file without the need for a shell interpreter:
./hello.sh.x
"shc" is a shell script compiler for Linux. It converts a shell script into a standalone binary executable. This can be useful for distributing scripts or making them more secure by hiding their source code.
PLEASE SUBSCRIBE :)
PLEASE HIT LIKE IF IT HELPED :)
GIVE SUPPORT - / lazysysad
BUY ME A COFFEE - https://www.buymeacoffee.com/lazysysad
PAYPAL - https://www.paypal.com/donate/?hosted...
Drop me your feedback and comments.
That's all for now.
If this video helped you in any way, please like share and subscribe!
Thank you!!!
Watch video Hide your source code and prevent future modifications to your shell scripts in online without registration, duration hours minute second in high quality. This video was added by user The Lazy SysAdmin 03 April 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 4,941 once and liked it 296 people.