提问: SHC怎么不能运行在UBUNTU啊?
问题描述: 我的操作过程是这样的,首选sudo apt-get install shc
然后用shc -r -f XXX.sh 最后却怎么都运行不了xxx.sh.x.c有那位高手指教啊!
[问题]SHC怎么不能运行在UBUNTU啊?
-
- 帖子: 16
- 注册时间: 2006-01-11 17:37
-
- 帖子: 1331
- 注册时间: 2006-07-09 12:22
- 来自: 南京
代码: 全选
It's function really isn't a compiler: instead, it encrypts the shell script, and puts a C wrapper around it that, when run, decrypts the script and calls the requested shell for execution. Therefore, you must have a shebang line (#!/bin/sh or whatever). That also means it isn't limited to shell scripts: you can "compile" a Perl script just as easily.
-
- 帖子: 16
- 注册时间: 2006-01-11 17:37
kismet@SerVer:~$ sudo shc -v -T -r -f kk
shc shll=sh
shc [-i]=-c
shc [-x]=exec '%s' "$@"
shc [-l]=
shc opts=
shc: cc kk.x.c -o kk.x
kk.x.c:103:22: error: sys/stat.h: No such file or directory
kk.x.c:104:23: error: sys/types.h: No such file or directory
kk.x.c:106:19: error: errno.h: No such file or directory
kk.x.c:107:19: error: stdio.h: No such file or directory
kk.x.c:108:20: error: stdlib.h: No such file or directory
kk.x.c:109:20: error: string.h: No such file or directory
kk.x.c:110:18: error: time.h: No such file or directory
kk.x.c:111:20: error: unistd.h: No such file or directory
kk.x.c: In function 'key_with_file':
kk.x.c:173: error: array type has incomplete element type
kk.x.c:174: error: array type has incomplete element type
kk.x.c:180: warning: incompatible implicit declaration of built-in function 'memset'
kk.x.c: In function 'chkenv':
kk.x.c:225: warning: incompatible implicit declaration of built-in function 'sprintf'
kk.x.c:226: warning: assignment makes pointer from integer without a cast
kk.x.c:230: warning: incompatible implicit declaration of built-in function 'strlen'
kk.x.c:234: warning: incompatible implicit declaration of built-in function 'strdup'
kk.x.c:237: warning: incompatible implicit declaration of built-in function 'sscanf'
kk.x.c: In function 'xsh':
kk.x.c:305: error: 'time_t' undeclared (first use in this function)
kk.x.c:305: error: (Each undeclared identifier is reported only once
kk.x.c:305: error: for each function it appears in.)
kk.x.c:305: error: expected expression before ')' token
kk.x.c:306: error: expected expression before ')' token
kk.x.c:321: warning: incompatible implicit declaration of built-in function 'calloc'
kk.x.c:337: warning: incompatible implicit declaration of built-in function 'malloc'
kk.x.c:340: warning: incompatible implicit declaration of built-in function 'memset'
kk.x.c:341: warning: incompatible implicit declaration of built-in function 'memcpy'
kk.x.c:347: warning: incompatible implicit declaration of built-in function 'malloc'
kk.x.c:350: warning: incompatible implicit declaration of built-in function 'sprintf'
kk.x.c: In function 'main':
kk.x.c:384: warning: incompatible implicit declaration of built-in function 'fprintf'
kk.x.c:384: error: 'stderr' undeclared (first use in this function)
kk.x.c:385: error: 'errno' undeclared (first use in this function)
shc: Success
shc shll=sh
shc [-i]=-c
shc [-x]=exec '%s' "$@"
shc [-l]=
shc opts=
shc: cc kk.x.c -o kk.x
kk.x.c:103:22: error: sys/stat.h: No such file or directory
kk.x.c:104:23: error: sys/types.h: No such file or directory
kk.x.c:106:19: error: errno.h: No such file or directory
kk.x.c:107:19: error: stdio.h: No such file or directory
kk.x.c:108:20: error: stdlib.h: No such file or directory
kk.x.c:109:20: error: string.h: No such file or directory
kk.x.c:110:18: error: time.h: No such file or directory
kk.x.c:111:20: error: unistd.h: No such file or directory
kk.x.c: In function 'key_with_file':
kk.x.c:173: error: array type has incomplete element type
kk.x.c:174: error: array type has incomplete element type
kk.x.c:180: warning: incompatible implicit declaration of built-in function 'memset'
kk.x.c: In function 'chkenv':
kk.x.c:225: warning: incompatible implicit declaration of built-in function 'sprintf'
kk.x.c:226: warning: assignment makes pointer from integer without a cast
kk.x.c:230: warning: incompatible implicit declaration of built-in function 'strlen'
kk.x.c:234: warning: incompatible implicit declaration of built-in function 'strdup'
kk.x.c:237: warning: incompatible implicit declaration of built-in function 'sscanf'
kk.x.c: In function 'xsh':
kk.x.c:305: error: 'time_t' undeclared (first use in this function)
kk.x.c:305: error: (Each undeclared identifier is reported only once
kk.x.c:305: error: for each function it appears in.)
kk.x.c:305: error: expected expression before ')' token
kk.x.c:306: error: expected expression before ')' token
kk.x.c:321: warning: incompatible implicit declaration of built-in function 'calloc'
kk.x.c:337: warning: incompatible implicit declaration of built-in function 'malloc'
kk.x.c:340: warning: incompatible implicit declaration of built-in function 'memset'
kk.x.c:341: warning: incompatible implicit declaration of built-in function 'memcpy'
kk.x.c:347: warning: incompatible implicit declaration of built-in function 'malloc'
kk.x.c:350: warning: incompatible implicit declaration of built-in function 'sprintf'
kk.x.c: In function 'main':
kk.x.c:384: warning: incompatible implicit declaration of built-in function 'fprintf'
kk.x.c:384: error: 'stderr' undeclared (first use in this function)
kk.x.c:385: error: 'errno' undeclared (first use in this function)
shc: Success