Execute a ksh file on Unix

ferrari75k Posted messages 13 Status Membre -  
 ferrari75k -
Hello,

I have a problem executing a ksh file on Unix. When I run it (./my_file.ksh), I get the following error message:

bad interpreter: a file or a directory in the path name does not exist

What should I add to PATH?

Thank you.

5 réponses

doctormad
 
Hello,

ksh my_file.ksh (or /bin/ksh)

or chmod u+x my_file.ksh then ./my_file.ksh

If it doesn't work, there is an error in your script.
3
ferrari75k Posted messages 13 Status Membre 2
 
A small clarification, the ksh executable is correctly defined in PATH (/usr/bin)!
0
ferrari75k Posted messages 13 Status Membre 2
 
I have another problem:

Cannot open /data1/Test

As for permissions, I set it to 777 but it's still not working, do you know where the problem might come from?
0
ferrari75k Posted messages 13 Status Membre 2
 
Actually, I have a Java program where I run a ksh:

Runtime.getRuntime().exec(mon_programme.ksh);

I tested this on another Unix machine and it worked, now it doesn't work anymore and the error is:

Exception java.io.IOException: mon_programme.ksh not found

I don't see where the problem comes from since it worked on the other Unix machine.
0
ferrari75k
 
Instead of using
Runtime.getRuntime().exec(mon_programme.ksh);
I used
Runtime.getRuntime().exec(./mon_programme.ksh);

and it works
thank you for your responses ;-)
0