how to encript a shell

I have a unix shell, there is a way to encript the whole shell, and be able to run the encripted shell, so I can give my client the encripted shell, and he can't see the code I wrote?

Shell scripts can not be encrypted and run from the encrypted state.

and there is a trick to do it? I meant to have a shell, but hide the code?

I think that you misunderstood me.

You can encrypt a shell script but, once it is encrypted, you can not execute it unless you decrypt it. This, therefore, means that the script is still unsecure and your client will be able to view your code if he's determined to.

All he has to do is read the decrypted script while it is running.

Sorry, I can make the answer simpler. If you want the code hidden, you have to control it at the Unix read/write/execute file security level. If your client owns the system, he'll be able to gain whatever access he needs to so he can view the code.

The short answer to your question is that you will not be able to prevent him from viewing your script.

There is a trick you can use to hide the code of a script: just use gzexe.

But it is only superficially hidden since gzexe -d brings it back to a decompressed state.