ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello, this is my first post in linuxquestions community.
I realized a perl script for Linux distributions and I would distribute this software in executable format, but at moment I would not distribute the source file.
Exist it a method to converte the perl script in executable format?
It is possible to compile Perl scripts into executable binaries. You actually have two options there: to compile to Perl bytecode (which will be executed by the client's Perl interpreter) and to native instructions (by generating and compiling C code). See the perlcc manual page for more information. Note the manual page's disclaimer on the experimental nature of this feature. Also, keep in mind that any time you distribute binary-only distributions you decrease the audience that can use your application.
Just a notice. I compiled a perl script and i had a segmentation fault when the file was executed. So you have to take a look about this programming.
More information about that is here: http://perldoc.perl.org/index-tutorials.html
1. You can include your license in the program. For open source program suitable are BSD and GPL licenses. 2. You mean to have a simple shell script that work like a program? If yes, probably you can. The nVIDIA graphics drivers are made in SHELL script.It is only a shell script that make all the things like a program. The script is very big. Almost 10 Mb. You can't write so big script. I suspect there is a program for this. Just an idea. Can you make a C/C++ program and a SHELL scrip that manage this program? In that way you have a compiled source code and a shell script that run and manage your program. It is simple to be done and useful.
You can base your license on some ready license or can make new license for yourself. Many people base thems licenses on the BSD license and include additional conditions.
nhydra: I believe nVidia's drivers are distributed in a single file composed of both the installation script and the binary data. That is why the file is so large. When you run the file, your shell begins stepping through the script, until it hits a command that uses most of the rest of the data as binary input. Because utilities like tar and gzip can take data in on standard input, it is possible to "hard-code" this data inline into the file and then pass it through the decompression utility inside the interpreted script. Another alternative would be to issue a command from the script that uses the script itself as input, disregarding the first n lines, which are not binary (i.e. they are interpreted by the shell). These methods do not hide the details of the installation mechanism, but they do keep the drivers binary and make it easier for a user to install (since they only have to worry about one file).
Shifter: I remember a question about converting a shell script into a binary here on LinuxQuestions some time ago, but I can't seem to find it. Doing a Google search may reveal a program that will convert it (from source script to binary) for you, but I think it would be easier to use an alternate method. The difference between shell and Perl is that Perl is actually compiled into an intermediary non-human-readable binary format (bytecode) and then executed; it's kind of like a Java class (IIRC) except the bytecode is recompiled every time it's run. Shell, on the other hand, is simply a list of text commands; it is not compiled in any way. Therefore, there are no builtin ways to compile a binary version of a shell script (because shells simply don't work that way). An alternative, then, would be to somehow encrypt your script and place it into a separate file. You can then use a binary program (a Perl script, or C++ program, for example) to decrypt the file and pass each command, one by one, to a shell interpreter. (Make sure to disable the history on this shell, first!) This would accomplish your goal of keeping the script's actions secret.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.