Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
i have written shell scripts and i want to convert all these to binary.
So please tell me how can i convert these shell scripts into binary files.
I am using RedHat 7.0 and 3.0.
Write a program and compile it. Then you're done.
Seriously, you don't say what the scripts are written in now, what you're trying to do, or what programming language(s) you know. You say you want a 'binary' file...do you mean an encoded file that no one else can edit, or a compiled executable???
Well if you wrote them in bash, there is no converting them to binary, there is no bash compiler. However, you can rewrite them in C or C++ and then compile them ... it will be rather difficult tho. But, why do you want to do this ? Are you sure you want to ?
But, why do you want to do this ? Are you sure you want to ?
For OP: The standard question is: What problem are you trying to solve? People typically write shell scripts for quick and dirty solutions (which can easily be changed). For a real application, where speed matters, write it in C.
There are some bash compilers around. But as far as I know, all that these do is to write a program that in turn, dumps the script into a temporary file and then run it. I might very well be wrong, but I don't think so.
If all you want is to hide the code, then these techniques are not exactly the best way to proceed because anyone should be able to look into that temporary file. So, write a program in C or whatever and compile it. Compiling bash is a lame trick that doesn't solve any problem of those that are inherent to bash.
the other thing you can do is wrap the programs you call in the script in system() calls in c. but a crafty script-kiddie could use strings to grep thru your binary and get an idea of what you're doing.