1751720 Members
3405 Online
108781 Solutions
New Discussion юеВ

Shell error

 
SOLVED
Go to solution

Shell error

Hi Guys,

I am getting below error , after exicuting script.

interpreter "/bin/ksh" not found
file link resolves to "/usr/bin/ksh"
ksh: ./test.ksh: not found.

user is using /bin/ksh shell also.

Please assist.
11 REPLIES 11
Suraj K Sankari
Honored Contributor

Re: Shell error

HI,

What did you put #/usr/bin/ksh or /usr/bin/ksh ?

Suraj

Re: Shell error

Hi Suraj,

I put #/bin/ksh
Also tried with #/usr/bin/ksh

Peter Nikitka
Honored Contributor

Re: Shell error

Hi,

please check, if the first (and the following lines of the script as well) does not end with a windows line termination (carriage return + linefeed).

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Venkatesh BL
Honored Contributor

Re: Shell error

> ksh: ./test.ksh: not found.

This means that 'ksh' is complaining that the script file ./test.ksh is missing...
Suraj K Sankari
Honored Contributor

Re: Shell error

Hi Pratibha,

can you post your script
or try like this
#!/bin/ksh

Suraj
OldSchool
Honored Contributor

Re: Shell error

what's the output from

ls -l /bin/ksh /usr/bin/ksh
mobidyc
Trusted Contributor
Solution

Re: Shell error

Edit your script with vi.
enter the following command :
:set list

and look if you have any ^M caracters at line end.
delete them if you find it.

check with an echo $PWD in you script to verify you are in the correct dir (which contains test.ksh).

i've also had your problem with a customer script, he has modified its ~/.profile file by adding :
ENV=~/.khshrc

i spent some time to find it ...

so check your environment vars.

Regards,
Cedrick Gaillard
Best regards, Cedrick Gaillard
James R. Ferguson
Acclaimed Contributor

Re: Shell error

Hi:

You probably modified (or created) you file on a Windows server and added carriage-returns to its lines. See my comments here along with the poster's problem description (which matches yours):

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1336139

Regards!

...JRF...

Re: Shell error

Hi Cedrick ,

You mean to say need to add ENV=~/.khshrc in to users .profile?

thanks.