Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I want to convert my shell scripts into binary executable so that nobody else could edit or read it.Is there any way to convert it into binary executable?

share|improve this question
14  
Don't do it! –  l0b0 Feb 14 '13 at 11:23
add comment

1 Answer 1

up vote 15 down vote accepted

shc is what you're looking for. get it here: shc
Extract, cd into dir, make and then ./shc -f SCRIPT. Done.

Everything you need to do this, you find here:
SHC Howto

share|improve this answer
4  
+1 wow, that is interesting. Just beware that if the process is exactly as it is described, this is a weak method of concealing a password -- it could still be extracted by someone who knows how executables are structured. However, it would be very effective for obscuring a script from casual observers. I'd be interested to learn if scripts pre-compiled this way are faster to execute. –  goldilocks Feb 14 '13 at 6:48
11  
Note that it doesn't work with bash (or sh based on bash), as one can do: env SHELLOPTS=verbose ./script.x to see the content of the script. There's probably easy ways to bypass with other shells as well. –  Stéphane Chazelas Feb 14 '13 at 11:14
2  
From the shc man page, "Unfortunatelly, it will not give you any speed improvement as a real C program would." datsi.fi.upm.es/~frosal/sources/shc.html –  Adam Feb 14 '13 at 19:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.