|
2015-02-03
, 19:04
|
|
Posts: 5,339 |
Thanked: 4,133 times |
Joined on Jan 2010
@ Israel
|
#42
|
§ shc itself is not a compiler such as cc, it rather encodes and encrypts a shell script and generates C source code with the added expiration capability. It then uses the system compiler to compile a stripped binary which behaves exactly like the original script. Upon execution, the compiled binary will decrypt and execute the code with the shell –c option. Unfortunately, it will not give you any speed improvement as a real C program would.
§ shc's main purpose is to protect your shell scripts from modification or inspection. You can use it if you wish to distribute your scripts but don't want them to be easily readable by other people.
tar xvfz shc-3.8.9.tgz cd /home/nemo/Downloads/shc-3.8.9
gcc shc-3.8.9.c -o shc
shc -f myscript.sh gcc myscript.sh.x.c -o mybinary
myscript.sh myscript.sh.x myscript.sh.x.c
tar xvfz shc-3.8.9.tgz cd /home/nemo/Downloads/shc-3.8.9
cd /home/nemo/Downloads/shc-3.8.9 make
shc -f myscript.sh cc -Wall myscript.sh.x.c -o mybinary
myscript.sh myscript.sh.x myscript.sh.x.c
#!/bin/bash dir=${PWD##*/} ls -a|grep ".*\.\(sh\)"|while read line; do shc -f "$line"; done ls -a|grep ".*\.\(x.c\)"|while read line; do gcc "$line" -o "${line/.sh.x.c/}"; done rm -f *.x* && mkdir -p $dir-source && mv -f *.sh $dir-source
cd /path/to/scripts_dir sh binary_creator
|
2015-02-04
, 03:49
|
|
Posts: 6,436 |
Thanked: 12,701 times |
Joined on Nov 2011
@ Ängelholm, Sweden
|
#43
|
|
2015-02-04
, 06:38
|
|
Posts: 5,339 |
Thanked: 4,133 times |
Joined on Jan 2010
@ Israel
|
#44
|
Peoples inventing new things just not to start learning real programming. It's always easier to say: "I'm not a programmer, i just know how to write some scripts". Sad story
|
2015-02-04
, 06:56
|
|
Posts: 6,436 |
Thanked: 12,701 times |
Joined on Nov 2011
@ Ängelholm, Sweden
|
#45
|
|
2015-02-04
, 07:22
|
|
Posts: 5,339 |
Thanked: 4,133 times |
Joined on Jan 2010
@ Israel
|
#46
|
Having two academic hours per day is enough for everybody to start learning any programming language. But it's personal decision of everybody.
The Following User Says Thank You to Schturman For This Useful Post: | ||
|
2015-02-04
, 07:27
|
|
Posts: 6,436 |
Thanked: 12,701 times |
Joined on Nov 2011
@ Ängelholm, Sweden
|
#47
|
|
2015-02-04
, 07:37
|
|
Posts: 5,339 |
Thanked: 4,133 times |
Joined on Jan 2010
@ Israel
|
#48
|
Using shc is okay for "hiding" script code. What the purpose of shc in sailfish?
The Following 2 Users Say Thank You to Schturman For This Useful Post: | ||
|
2015-02-04
, 12:20
|
Posts: 1,269 |
Thanked: 3,961 times |
Joined on May 2011
@ Brazil
|
#49
|
Peoples inventing new things just not to start learning real programming. It's always easier to say: "I'm not a programmer, i just know how to write some scripts". Sad story
|
2015-02-04
, 14:11
|
Community Council |
Posts: 4,920 |
Thanked: 12,867 times |
Joined on May 2012
@ Southerrn Finland
|
#50
|
Tags |
jolla phone, on device |
Thread Tools | |
|
I may be due to wipe and refresh my Jolla, I have edited lots of qml files all over the system, including in root, so maybe things are a bit messed up!, oh well, all part of the fun!, thanks again for your help
As per NielDK's suggestion, I may set up rpmbuild in Home and give that way a try.
Regards,
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..