LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   /bin/ksh: bad interpreter: No such file or directory (https://www.linuxquestions.org/questions/linux-software-2/bin-ksh-bad-interpreter-no-such-file-or-directory-4175447653/)

thomas2004ch 01-29-2013 04:27 AM

/bin/ksh: bad interpreter: No such file or directory
 
Hi,

I use the RH Linux and the bash shell. I got a ksh script from my partner. As I run this script I got error as follow:
Code:

-bash: ./compileExample: /bin/ksh: bad interpreter: No such file or directory
Any suggestion?

Regards

linosaurusroot 01-29-2013 04:45 AM

Does your file have DOS-style line endings? Convert with dos2unix.

shivaa 01-29-2013 04:58 AM

Check whether you've ksh shell installed or not, as:-
Code:

~$ which ksh
Also check what's script interpreter, (it's set on top of your script):
Code:

#!/bin/ksh

thomas2004ch 01-29-2013 05:03 AM

Quote:

Originally Posted by linosaurusroot (Post 4879723)
Does your file have DOS-style line endings? Convert with dos2unix.

I've converted it with dos2unix. But this doesn't help.

thomas2004ch 01-29-2013 05:04 AM

Quote:

Originally Posted by shivaa (Post 4879736)
Check whether you've ksh shell installed or not, as:-
Code:

~$ which ksh
Also check what's script interpreter, (it's set on top of your script):
Code:

#!/bin/ksh

which ksh returns:
Code:

/usr/bin/which: no ksh in (/usr/local/bin:/bin:/usr/bin:/home/msg61/bin)
Teh script interpreter is
Code:

#!/bin/ksh
This can be found at the beginning of the script.

thomas2004ch 01-29-2013 05:07 AM

And here is the script:
Code:

#!/bin/ksh

if [ "$JAVA_HOME" = "" ] ; then
  echo "[ERROR] JAVA_HOME not set"
  exit 1
elif [ ! -f $JAVA_HOME/bin/javac ] ; then
  echo "[ERROR] javac in $JAVA_HOME/bin/ not found. Wrong JAVA_HOME=$JAVA_HOME??"
  exit 1
fi

if [ "$JBOSS_HOME" = "" ] ; then
  echo "[ERROR] JBOSS_HOME not set"
  exit 2
fi

# Classpath erweitern
MYCLASSPATH="."

if [ ! -f ./axis2-wsclient-gen.jar ] ; then
  echo "[ERROR] axis2-wsclient-gen.jar in ./ not found"
  exit 13
fi
MYCLASSPATH="$MYCLASSPATH:axis2-wsclient-gen.jar"

if [ ! -f ./axis2-wrapper-gen.jar ] ; then
  echo "[ERROR] axis2-wrapper-gen.jar in ./ not found"
  exit 13
fi
MYCLASSPATH="$MYCLASSPATH:axis2-wrapper-gen.jar"

if [ ! -f ./BPClient.jar ] ; then
  echo "[ERROR] BPClient.jar in ./ not found"
  exit 13
fi
MYCLASSPATH="$MYCLASSPATH:BPClient.jar"

if [ ! -f $JBOSS_HOME/bin/client/jboss-client.jar ] ; then
  echo "[ERROR] jboss-client.jar in $JBOSS_HOME/bin/client/ not found"
  exit 13
fi
MYCLASSPATH="$MYCLASSPATH:$JBOSS_HOME/bin/client/jboss-client.jar"

for f in $(ls lib/axis2/*.jar)
do
    MYCLASSPATH="$MYCLASSPATH:$f"
    #print "File: $f"
done

export MYCLASSPATH

$JAVA_HOME/bin/javac -encoding ISO-8859-1 -classpath $MYCLASSPATH -d bin src/de/msg/businesspartner/client/sample/jboss/*.java


TobiSGD 01-29-2013 05:27 AM

This is a ksh script. To interpret it you need ksh. You may be able to run it with bash if you replace the ksh in the first line, but I can't say if it will work as intended. The easiest way would be to just install ksh.

linosaurusroot 01-29-2013 06:00 AM

Installing ksh would usually be done with a package manager: "sudo zypper install pdksh" or similar.

chrism01 01-29-2013 07:27 AM

Assuming 'RH Linux' means RHEL, use
Code:

yum install ksh


All times are GMT -5. The time now is 06:07 PM.