-1

My concern is I have created a shell script. Now I need to share the script with my friends. All that i want is they should not be able to open and read the code but they should be able to execute it.

Please remember, he will be using the script on his computer, so chmod will not work. I want an automatic way by which he can just copy the script on his drive and execute it. But he should not be able to see the code inside the script.

Please help.

Martin Thorsen Ranang
  • 2,394
  • 1
  • 28
  • 43
ShobhitSaxena
  • 73
  • 5
  • 12
  • 1
    I don't think this is going to be possible - shell scripts are just text files - if they are executable then they are readable too. – Paul R Feb 03 '15 at 09:17
  • Please see this answer regarding how to compile shell scripts: http://stackoverflow.com/a/6438272/4437569 – John Castleman Feb 03 '15 at 09:20
  • 3
    Are you sure it is worth spending your time on having friends avoiding looking inside your script? Do you still want to keep them as friends? – Basile Starynkevitch Feb 03 '15 at 09:44
  • 1
    Possible duplicate: http://stackoverflow.com/questions/17750486/how-can-i-encrypt-bash-script-source-code – Ignitor Feb 03 '15 at 12:52

1 Answers1

1

Since real encryption will not be possible, you could instead use an obfuscator, e.g. http://sourceforge.net/projects/shellcrypt/ (I didn't try it though)

Ignitor
  • 2,907
  • 33
  • 50
  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Mihai Maruseac Feb 03 '15 at 12:04
  • 2
    @MihaiMaruseac: I don't think this counts as a "link only" answer - it suggests using an obfuscator, which is a perfectly valid answer, and the link is just a further suggestion for a particular obfuscator. – Paul R Feb 03 '15 at 12:45