Cygwin – ksh Not Found by Bash but Present in bin/ksh

cygwin

I have installed cygwin on my windows XP desktop on C:. It works fine except when I launch a .ksh. I had this error message :

bash: ./xxx.ksh: /bin/ksh : Bad interpreter:No such file or directory

I 've looked in the /bin folder with ls -al ksh and I found ksh.exe.lnk (a shortcut in my windows explorer. The target of this shortcut exists on my filesystem – pdksh.exe).
I 've changed in my xxx.ksh

#!/bin/ksh

in

#!/bin/pdksh

And it works fine, but that's a ponctual solution…

Best Answer

Did you create the symbolic link with cygwin, or did you create it as a shortcut in windows? The links cygwin creates are compatible with windows, but shortcuts you create in windows aren't always compatible with cygwin unless you manually change them. See this.

Use ln -s /bin/pdksh.exe /bin/ksh in cygwin to create the symlink (see here).

Edit: fixed link direction