shc compiler issue

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 !

I don't have that problem...

root@bt> shc -f run
root@bt> ls -lrt run*
-rwxr-xr-x 1 root root    22 2012-01-16 08:52 run
-rw-r--r-- 1 root root  9270 2012-01-16 08:54 run.x.c
-rwx--x--x 1 root root 10276 2012-01-16 08:54 run.x
root@bt> 

How are you using it?

--ahamed

This is how it is showing up the entire code :frowning:

executing it using:

./run.x

+ grep -v -f cmp_data.txt cmp1_data.txt
+ 1>> tmp3.txt
+ cat temp3.txt temp6.txt
+ 1> temp_order.txt
+ awk {
printf("%-32s%-32s%-20s%-7s%-3s\n",$1,$2,$3,$4,"DDL")
} tmp2.txt
+ 1> tmp4.txt
+ awk {
printf("%-32s%-32s%-20s%-7s%-3s\n",$1,$2,$3,$4,"ERWIN")
} tmp3.txt
+ 1>> tmp4.txt
+ sort -k1,1 -k2,2 tmp4.txt
+ 1> temp8.txt
+ cat temp3.txt temp8.txt
+ 1> temp_data.txt
+ sed s/ 1 /NOT NULL/g;s/ 0 /NULL    /g temp_data.txt
+ 1> report_data.txt
+ sed s/ 1 /NOT NULL  /g;s/ 0 /NULL      /g temp_order.txt
+ 1> report_order.txt
+ awk {

len=length($0)
if( len > 0)
{
a[$1$2$3]++
b[$1$2$3]=$0
}
}
END {
for (x in a)
        {
        if(a[x] == 1)
                {
                printf b[x]     "\n"
                }
        }
}
 report_data.txt
+ 1> missing_columns.txt
+ rm -f temp.txt temp1.txt temp2.txt temp3.txt temp4.txt temp6.txt temp8.txt temp_data.txt temp_order.txt
+ rm -f tmp.txt tmp2.txt tmp3.txt tmp4.txt tmp5.txt tmp6.txt tmp7.txt
+ rm -f ddl.txt cmp.txt cmp1.txt cmp1_col.txt cmp1_data.txt cmp1_tbl.txt cmp_col.txt cmp_data.txt cmp_tbl.txt temp_data.txt

You must have put set -x in your original script. Remove it, recompile and test it.

--ahamed

1 Like

I am using :

shc -v -r -T -f scriptname

No - in the file called scriptname there is the statement

set -x
1 Like

thx guys! It is working now !

---------- Post updated at 06:10 PM ---------- Previous update was at 04:37 PM ----------

Having problem with script expiration option :

shc -v -r -T -e 01/01/2013 -f bt.txt 

Error :

/usr/lib/hpux32/dld.so: Unsatisfied code symbol 'atoll' in load module 'shc'.
Killed

Please help !

OS: AIX 6.1

#>rpm -qa
cdrecord-1.9-7
mkisofs-1.13-4
unzip-5.51-1
screen-3.9.10-2
bash-doc-3.0-1
bash-3.2-1
gcc-4.2.0-3
AIX-rpm-6.1.5.0-6

I have compiled a simple program using shc but when I try to execute the program it just says "Killed";

#>cat abc.sh

#!/usr/bin/sh
echo Hello World
exit 0

/shc/shc-3.4#>./shc -f abc.sh

/shc/shc-3.4#>./abc.sh.x
Killed

Any help will be greatly appreciated.
Thank you.