C++/Compiling a linux exe including a Shell Script
I wanna create a exe(linux) which has the Shell Script and Simple CPP file which calls the Shell Script using system() function. Lets say exe name 'myInstaller' which has files myintsaller.cpp and myShell.sh. When i run the exe myInstaller , it must execute shell script. I want to do like this so i can protect my Shell Script code ,which has over 3000 lines of Code.
How do i do this ... I m in real need of this.
What do you mean by "protecting" the shell script? The script cannot be hidden.
Make sure the script is executable (-r-xr-xr-x), and is in the same directory as your compiled program. Calling the script is done like this:
for script mysh.sh
the cpp file is like this:
If you compile the cpp file and run the program, you will see "Hello" printed.
Perhaps you could embed the script like this example:
system("sh <<-EOF\necho HELLO EMBEDDED\nEOF");
but that would be so hard to do for a very large script.
I hope that helps.