Shc : trying to test functionality "test" compiling but can not execute


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shc : trying to test functionality "test" compiling but can not execute
# 1  
Old 08-12-2013
Shc : trying to test functionality "test" compiling but can not execute

I am testing shc to see if it would help with my need.

Im at a point where Im trying to compile and test the "test.ksh" file that comes in the tar ball :

Code:
shc-3.8.9> shc -v -r -f test.ksh
shc shll=ksh
shc [-i]=-c
shc [-x]=exec '%s' "$@"
shc [-l]=
shc opts=
shc: cc  test.ksh.x.c -o test.ksh.x
shc: strip test.ksh.x
shc: chmod go-r test.ksh.x

Execution and the error I am getting :

Code:
 /home/popeye/shc-3.8.9> test.ksh.x
test.ksh.x[1]: exec: *15441*test.ksh.x: not found




shc version shc-3.8.9

on a box with:

Code:
Linux 2.6.32-358.2.1.el6.x86_64  Wed Mar 13 00:26:49 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Code that I'm trying to compile (also part of the tar ball) :

Code:
#! /bin/ksh -x
echo "\$@ is $@"
echo "command line: $0 $*"
echo "hello world"
# Added
echo "[$$] PAUSED... Hit return!"
read DUMMY
exit 0

Thanks very much in advance for any help you can provide.
# 2  
Old 08-20-2013
try:

Code:
./test.ksh.x

# 3  
Old 11-06-2013
I have the same issue with similar error as below...

Code:
$ ./tSch_Csc.sh.x
./tSch_Csc.sh.x: /home/MAIN/REP/*64241*./tSch_Csc.sh.x: No such file or directory
./tSch_Csc.sh.x: line 0: exec: /home/MAIN/REP/*64241*./tSch_Csc.sh.x: cannot execute: No such file or directory

can someone please advise where this is going wrong...

I have also tried to compile the ".c " file manually as below which shc generated. but no luck...

Code:
gcc tSch_Csc.sh.x.c -o tSch_Csc.sh.x

# 4  
Old 11-06-2013
Works for me on my Slackware 14.1 box. Maybe try using strace to see if anything is missing:

Code:
strace -o output shc -v -r -f test.ksh

On my box:

Code:
shc -v -r -f testscript.ksh
shc shll=ksh
shc [-i]=-c
shc [-x]=exec '%s' "$@"
shc [-l]=
shc opts=
shc: cc  testscript.ksh.x.c -o testscript.ksh.x
shc: strip testscript.ksh.x
shc: chmod go-r testscript.ksh.x

file testscript.ksh.x
testscript.ksh.x: ELF 32-bit LSB  executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped

./testscript.ksh.x
I'm compiled!

# 5  
Old 11-06-2013
Try

Code:
shc -v -r -T -f script.sh

# 6  
Old 11-06-2013
Thanks for your replies..

I did use below to create...
Code:
shc -v -r -T -f script.sh

The issue is that, it works fine on "Machine A" which is as below
Code:
uname -a
Linux Machine A 2.6.32-279.2.1.el6.x86_64 #1 SMP Thu Jul 5 21:08:58 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux

But when i move this script to "Machine B" which seem to be similar to A as below..
Code:
uname -a
Linux Machine B 2.6.32-279.2.1.el6.x86_64 #1 SMP Thu Jul 5 21:08:58 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux

Then, it throws these errors..
Code:
./tSch_Csc.sh.x
./tSch_Csc.sh.x: /home/MAIN/REP/*64241*./tSch_Csc.sh.x: No such file or directory
./tSch_Csc.sh.x: line 0: exec: /home/MAIN/REP/*64241*./tSch_Csc.sh.x: cannot execute: No such file or directory

I did try to copy the ".c" file to Machine B and compiled it and generated the script as below... but still no luck...

Code:
gcc tSch_Csc.sh.x.c -o tSch_Csc.sh.x

what could be missing.... or what else could i check for ...
# 7  
Old 11-06-2013
Code:
/home/MAIN/REP/*64241*

what is that?

If your folder really does have *'s in it, any use of the folder name unquoted will try and expand these *'s into other filenames. So it could be a bug in the script rather than shc.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

If test script error: "Missing ]"

EDIT: Resolved Resolved by changing the first line to bash rather than csh, does bash and csh treat the brackets differently? Hi all, I'm doing to some basic stuff to teach myself "if" I've written the following: #!/bin/csh echo "This script checks for the test file" ... (1 Reply)
Discussion started by: Meshuggener
1 Replies

2. UNIX for Dummies Questions & Answers

What is the significance of sh -s in ssh -qtt ${user}@${host} "sh -s "${version}"" < test.sh?

Please can you help me understand the significance of providing arguments under sh -s in > ssh -qtt ${user}@${host} "sh -s "${version}"" < test.sh (4 Replies)
Discussion started by: Sree10
4 Replies

3. Shell Programming and Scripting

Help with error "por: 0403-012 A test command parameter is not valid."

Hi, im asking for help with the next script: echo ^; then if then printf "\033 query1.sh: export TERM=vt100 export ORACLE_TERM=at386 export ORACLE_HOME=/home_oracle8i/app/oracle/product/8.1.7 export ORACLE_BASE=/home_oracle8i/app/oracle export... (8 Replies)
Discussion started by: blacksteel1988
8 Replies

4. Shell Programming and Scripting

please help me " aks primality test"

i want to write a shell script for aks primality test ,can anybody help me to how to use logarithmic and mod function in shell script (2 Replies)
Discussion started by: abhijeet vaidya
2 Replies

5. Shell Programming and Scripting

error "test: [-d: unary operator expected" very confused.

Im trying to check if a series of directory exists and if not create them, and am having issues. All the instances of test return with the error "test: #!/bin/bash location_Parent=~/Documents/sight_of_sound location_IMG=~/Documents/Sight_of_sound/IMG location_AUD=~/Documents/Sight_of_sound/AUD... (4 Replies)
Discussion started by: orionrush
4 Replies

6. Shell Programming and Scripting

if returns "unknown test operator"

Greetings, using ksh on Solaris, I am trying to identify the current version of a package installed on multiple servers using if statement in a precursor to upgrading. I have searched the forums and have found many hits, reviewed 3 pages and have tried the different variations noted there. Also... (3 Replies)
Discussion started by: 22blaze
3 Replies

7. UNIX for Dummies Questions & Answers

"test: argument expected" error

Hi, No need to say I'm new to unix shell scripting. I have a very simple script that goes this way: for datos in `ls -rt $UNXLOG/26-Jan*` do export arch=`echo $datos |cut -d, -f1` if then export linea1=`grep Debut ${arch}` export horatot=`echo $linea1 |cut -d' ' -f5` ... (7 Replies)
Discussion started by: mvalonso
7 Replies

8. Shell Programming and Scripting

Awk - to test multiple files "read" permission ?

Hi Masters, Iam new to this Forum and this is my first post. My question is: I've some datafiles belongs the type (A, B, C) in the location 'export/home/lokiman ' dataA1.txt dataB28.txt dataC35.txt 1) I've to check the read permission for each file, if it not there then I've to... (1 Reply)
Discussion started by: lokiman
1 Replies
Login or Register to Ask a Question