1830156 Members
7783 Online
109999 Solutions
New Discussion

shell error

 
hien
Occasional Advisor

shell error

hello guys..

i re run a script and i got this error. this script was running fine few minutes ago and this error suddenly appears. no updates done with the script..

>check

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

i wonder why is this happening..any ideas guys? i need it desperately...

7 REPLIES 7
Patrick Wallek
Honored Contributor

Re: shell error

It sounds like the script is looking for ksh to actually reside in /bin. It doesn't anymore. /bin/ksh is a link to /usr/bin/ksh.

Check the logic in the script and see if it is looking specifically for /bin/ksh anywhere.

Another thing to check is the first line of the script. If it is:

#!/bin/ksh

change it to

#!/usr/bin/ksh

and see what happens.
hien
Occasional Advisor

Re: shell error

thank you so much patrick but when i look at /bin, ksh is there and NOT A LINK. and i didnt touch it. anyways, sombday myt have deleted the link and copied the ksh in /bin. i think theres no difference if ksh in /bin is not a link to /usr/bin/ksh. what do u think? also, can we change timestamp backwards? since the timstamp of /bin/ksh and /usr/bin/ksh is the same...

also, any idea where could i search for any logs? i dont have root access.

i really appreciated your quick reply.
T G Manikandan
Honored Contributor

Re: shell error


# ll /bin
lr-xr-xr-t 1 root sys 8 Dec 6 14:43 /bin -> /usr/bin


The /bin directory is a link of the /usr/bin
So when you refer the /bin directory it refers the /usr/bin directory.
So the files are the same.
So there is nothing to change.
Make sure that the /bin is linked to /usr/bin.


check this white paper
http://docs.hp.com/hpux/onlinedocs/5963-8942/5963-8942.html
Bill Hassell
Honored Contributor

Re: shell error

/bin (and also /lib) have been obsolete for almost 10 years after the adoption of V.4 filesystem layout standards for Unix. Just like Solaris and other flavors of Unix, /bin is not a directory. Use the command ll -d /bin (notice -d) and you'll see that /bin is a transition link. If you type the command: ll /bin/ksh, it will appear to be there but that is the purpose for a symbolic link.

Apparently your script has some special code to detect a symlink. Simply change your script's loader directive (line 1) to: #!/usr/bin/ksh

It is important to note that transition links are temporary and may not exist in a future release of HP-UX. They were supposed to disappear at 10.20, then 11.0 but eventually, they will no longer exist, at least by default. 10 years should be long enough to cleanup all that old code. Retraining script writers seems to be the real problem.


Bill Hassell, sysadmin
Ian Lochray
Respected Contributor

Re: shell error

I have just encountered this problem when running a shell script. The answer was that someone had copied a new version of the script from their PC by ftping in binary mode. This had left all the Ctrl-M characters at the end of each line causing the error. When I fiexed the file with dos2ux all was OK again.
Rasheed Sonson
Occasional Advisor

Re: shell error

The last suggestion worked for me.
rene_48
New Member

Re: shell error

encountered the same error and the last soln woked for me perfectly...

thanks guys.. u r of great help..

more power.