Showing results for 
Search instead for 
Did you mean: 

/bin/sh not found

Go to solution
titi chen
Occasional Contributor

/bin/sh not found

Dear all,

My system is HPUX 11.31 with BOE. And I keep receiving /bin/sh not found when the system start up or if I running script...

Where and how do I change/set this default interpreter so it is directed to /usr/bin/sh?

Ganesan R
Honored Contributor

Re: /bin/sh not found


You should modify the script to use /usr/bin/sh instead of /bin/sh

Or you can copy the /bin/sh from some other system if you have.
Best wishes,

Wim Rombauts
Honored Contributor

Re: /bin/sh not found

I am not familiar with specific changes about the filesystem organization between HP-UX 11i v2 and HP-UX 11i v3, but I think that you may be missing a symbolic link from /bin to /usr/bin.
Is that so ?
And what happens if you create this one (ln -s /usr/bin /bin).
I think that if the link is missing, creating it would certainly solve the issue, and maybe a few future issues also.
Esteemed Contributor

Re: /bin/sh not found

first you should verify at /bin/ this file may exist but somehow the group/owner or permission has changed, will get this error. it should have below user /group permission.

-r-xr-xr-x 2 bin bin 491520 Dec 2 2002 sh

if this file doest exist you should identify same version of hpux OS system tar this file there and ftp over not working hpux system, and untar in /bin should be ok

let me know how it goes, thanks,
titi chen
Occasional Contributor

Re: /bin/sh not found

Thanks Ganesan,

Unfortunately i don't have any other system.

And your first suggestion means I should do the script editing each time I get a new script, event downloaded script from HP directed to /usr/bin/sh

Actually I was expecting 1 time and permanent action to solve this..

Robert-Jan Goossens
Honored Contributor

Re: /bin/sh not found


Run the tlinstall command

# tlinstall

titi chen
Occasional Contributor

Re: /bin/sh not found

Hi Wim,

The thing is no such /bin in my current HP UX 11.31 BOE. There's only /usr/bin, all sh, ksh, csh are located here.

And there' no such tlinstall command.

Other suggestion?


Roman Schmidt
Frequent Advisor

Re: /bin/sh not found


please create a symlink:

ln -s /usr/bin /bin

like this all scripts accessing /bin/sh are reidrected to /usr/bin/sh.
Honored Contributor

Re: /bin/sh not found

Hi titi,

lrwxr-xr-t 1 root sys 8 Apr 10 2002 /bin -> /usr/bin

Esteemed Contributor

Re: /bin/sh not found

attached here sh.tar for same version of OS incase if you falied with all suggested options,

Aneesh Mohan
Honored Contributor

Re: /bin/sh not found


I could see /bin link in my 11.31 system.

You may please do this.

# uname -a
HP-UX xxxxxxx B.11.31 U ia64 3902920412 unlimited-user license
# ls -lrtd /bin
lr-xr-xr-x 1 bin bin 8 Feb 24 16:27 /bin -> /usr/bin
# ls -lrtd /usr
dr-xr-xr-x 23 bin bin 8192 Feb 25 11:56 /usr

#ln -s /usr/bin /bin

Regular Advisor

Re: /bin/sh not found

on 11.31, /bin is a link to /usr/bin ..

no more to do ..
Dennis Handly
Acclaimed Contributor

Re: /bin/sh not found

>I keep receiving /bin/sh not found when the system start up or if I running script.

I assume this is not in single user mode after the system has come fully up.

As Wim mentioned you should have a symlink from bin -> /usr/bin and lib -> /usr/lib.
Tlinks were removed on 11.31 and replaced by permanent symlinks.
Occasional Visitor

Re: /bin/sh not found

This solution solved my problem.