Execute a ksh file on Unix

ferrari75k Posted messages 13 Status Member -  
 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 answers

  1. 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
  2. ferrari75k Posted messages 13 Status Member 2
     
    A small clarification, the ksh executable is correctly defined in PATH (/usr/bin)!
    0
  3. ferrari75k Posted messages 13 Status Member 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
  4. ferrari75k Posted messages 13 Status Member 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
  5. 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