SUMMARY: /bin/sh vs. /sbin/sh

From: Derek_Schatz@amat.com
Date: Fri Dec 19 1997 - 15:39:16 CST


Thanks to:
Richard Skelton [U.K.]
Birger [Norway]
Torsten [Germany]
Andy Paton [U.K.]
Stephen Frost [McLean, Virginia, USA]
David Thorburn-Gundlach [Athens, Georgia, USA]
Trevor Paquette [Calgary, Alberta, Canada]
Kevin Colagio [Rochester, New York, USA]
J. Bern [Trier, Germany]
David S. Foster [San Diego, California, USA]
Alan Chan [Vancouver?, BC, Canada]

(quite a geographically broad set of responses, eh?)

The Original Question:
----------------------
I've RTFM'd and searched the archives, and am still trying to determine
the difference between /usr/bin/sh and /sbin/sh under Solaris 2.5.1.
The former is 197672 bytes in size, and the latter is 89492 bytes. Also,
the man page for sh indicates that /usr/xpg4/bin/sh is actually the
same as /usr/bin/ksh (Korn), further confusing things.

My guess here is that /sbin/sh is perhaps a statically linked version
to be used when only the root filesystem has been mounted. Is this
correct? If so, is there a statically linked version of ksh?

Also, on a related note, what is the preferred method of changing the
default shell for root? Is there any problem with just editing this
directly in the /etc/passwd file?

The Responses:
--------------
My hunch was confirmed that /sbin/sh is a statically linked shell.
This is of course most necessary when only the / filesystem is
available and you need to be able to log in as root.

Most also warned of the danger of messing with the root account's
default shell. I'm well aware of this; my actual goal was to use
a static Korn shell instead, but I'm told that no such animal
exists. I imagine it'd be rather fat if it did.

Many recommended use of vipw to do any editing of /etc/passwd.
vipw enables editing of this file while doing the proper file
lock and consistency checks.

Andy Paton suggested adding the following to root's .profile:
[snipped]
  SHELL=/usr/bin/ksh
  EXPORT SHELL
Birger pointed out that given the above, one might want to
check that everything is OK before automatically starting the
new shell.

Thanks again.

Happy holidays!



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:12:11 CDT