Hello, I have some shellscripts internal company more by the need to conceal the code to protect passwords and others, we are using the SHC.
the shellscripts always worked without error, including cron.
after the SHC, if I run manually (. / shellscript) it works
if I put the same command to run in cron, hours works sometimes not.
only in cron does not work ...
already put in / usr / bin / run straight to the command still does not work ... anyone ever had a problem with the SHC? There is another that you can use instead of the SHC?
I'm sure that is not the shell script because without encrypting it runs without errors.
Use the following steps to encrypt.
Very thanks!
Last edited by Don Cragun; 03-06-2016 at 04:22 PM..
Reason: Add CODE and ICODE tags.
What Jim said was that you should not put a script which is intended to be executed only by root in /usr/bin. You may place the file somewhere safer, e.g /root/bin etc. I always place the cron scripts in /root/cron directory.
Anyway, please check /var/log/cron file for the error message as to why the script is not getting executed.
Most problems occur due to the PATH environment variable being not set explicitly in the script. It should work in a bash session, but not while executing through cron as it does not set PATH if not explicitly done so in the script.
I have used shc utillity to convert a shell script to it's compiled version.Inside this script i have called another shell script which is also in compled version.
Example:-
Main script:- main.sh.x
child script:- child.sh.x (this is called inside main.sh.x)
This child script will run in... (2 Replies)
Hello,
I would like to use shc on SUN 5.10 SPARC and HP UX Itanium 11.31 so that I could do some encrypting on my shell scripts.
But on these machines I don"t have cc or gcc.
I find a man who can download shc.c and send me the binary files.
You can download it here :
www datsi fi upm es... (3 Replies)
I am using the shc shell compiler, it works fine, just that when i execute it, it displays the code at the terminal. Is there any way to hide this as well? otherwise it beats the purpose of hiding the code.
Thanks ! (7 Replies)
I have two scripts test1.sh and test2.sh. test1.sh is calling test2.sh.
test2.sh is having some functions and password which we are using in test1.sh
test1.sh
#!/bin/sh
. test2.sh
echo "$test"test2.sh
#!/bin/sh
test=pravinO/P
pravin
Now use shc to protect my test2.sh and i modified... (5 Replies)
Hi all,
I'm trying to install shc on my clean solaris 10 so that I could do some encrypting on my shell scripts.
I've tried several ways but it gave me these error messages
# make
cc -Wall -O6 shc.c -o shc
cc: illegal option -Wall
*** Error code 1
make: Fatal error: Command failed... (6 Replies)
Hi all!
First of all, sorry for my poor english :-S
Well, I have some scripts in a SuSe server to encrypt... but all them must still working when I encrypt it, ok?
About the server, I have root access:
# id
uid=0(root) gid=0(root) groups=0(root)
# uname -a
Linux servername... (4 Replies)
Hello there. I would like to know how to use shc (the generic shell script compiler ) with octave scripts. With sh scripts it works fine (because it automatically recognizes the interpreter - here bash ). But when use with octave scripts like this easy one #! /usr/bin/octave
disp("testing...")... (0 Replies)
I have written a shell script called square, which prints the square of the input number, eg.
> square 4
16
There is a program called shc which compiles the shell scirpt and create a executable file and a c library file, namely square.x and square.x.c repectively.
If I would like to... (0 Replies)
Has anyone ever gotten shc compiler program to work. I am trying to encrypt
a bash script on centos. When I run the command "shc -f test.sh", the binary actually gets created; however, when I try to run the binary I get the following the error:
# ./test.sh.x
./test.sh.x: No such file or... (1 Reply)