Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Oct 2006 01:38:33 +0200
From:      Joerg Pernfuss <elessar@bsdforen.de>
To:        freebsd-questions@freebsd.org
Subject:   Re: Why csh on Root?
Message-ID:  <20061020013833.35ae8f1b@loki.starkstrom.lan>
In-Reply-To: <200610191303.k9JD322j081114@dc.cis.okstate.edu>
References:  <200610191303.k9JD322j081114@dc.cis.okstate.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
--Sig_Cyq/M_VRFj9JZz0hTO.G8yt
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

On Thu, 19 Oct 2006 08:03:02 -0500
Martin McCormick <martin@dc.cis.okstate.edu> wrote:

> 	Is there any particular reason why FreeBSD has csh as the
> default root shell?  Nothing really wrong with it except that I
> quit using csh about twelve years ago and so am a little rusty
> about the finer details when I come across a csh shell.  On a
> number of FreeBSD4.x systems, I used chsh to change root's shell
> after installing bash and the only thing I noticed was that one
> should be careful of the $PATH variable and make sure it at least
> hits all the same directories in the same order.  Other than
> that, it worked.
>=20
> 	On a recent upgrade to 5.4, I noticed the C shell is
> still default so I figured I would ask before changing it so as
> not to introduce hidden problems later.  Basically, I like bash
> better and also add a couple more paths such as /usr/local/etc
> for home-grown applications.
>=20
> 	Thanks for your thoughts.

On first look, FreeBSD seems to come with 3 shells: sh, csh and tcsh

Then again, that is not entirely true.

/bin/sh is actually an ash. Minimal POSIX sh with a few additions that
don't help it anyway near a friendly shell for interactive use.

Then csh and tcsh - they are one and the same, a tcsh.

25183 -r-xr-xr-x  2 root  wheel  333980  5 Sep 16:12 /bin/tcsh*
25183 -r-xr-xr-x  2 root  wheel  333980  5 Sep 16:12 /bin/csh*
^^^^^		  ^
same inode	  link count 2

The reasons for that are many.
- csh is the shell that originated in Berkeley (legacy reason)
- bash isn't quite released unter a two-clause BSDL, which isn't
  desireable as a part of the base (license reason)
- in case of a system failure, the root shell should work
  (single user reason)
- everybody that works a lot on the shell with modify his environment
  anyway to his personal preference (why-bother reason)
- probably more

Neither of these are by itself 100% convincing and you can construct
a "yeah but if..." without any problems. But everyone of these reasons
is by itself able to start one ceremonial bikeshed unlike anything
known to man so far.

Therefor, one could describe the status quo as a truce. The elephant
that everybody sees and noone talks about. The chance of getting a
really broad concensus on these topics is so slim, that it simply isn't
touched. Especially since it isn't broken.

One can add bash3, ksh93, zsh, ... to the system via ports and these
work. One can use toor and asign that user a different shell. One
can simply use `sudo bash' instead of normal `su'/`su -l'. The one
instance where one really needs the root csh is in case of a rather
bad system failure. And an unfamiliar scripting syntax is one's least
problem in that case anyway.

So, either chsh to /usr/local/bin/bash and use plain /bin/sh in
single user situations, or make a statically compiled /bin/bash.
If one is prepared for eventual fallout, the possibilities endless.

	Joerg
--=20
| /"\   ASCII ribbon   |  GnuPG Key ID | e86d b753 3deb e749 6c3a |
| \ / campaign against |    0xbbcaad24 | 5706 1f7d 6cfd bbca ad24 |
|  X    HTML in email  |        .the next sentence is true.       |
| / \     and news     |     .the previous sentence was a lie.    |

--Sig_Cyq/M_VRFj9JZz0hTO.G8yt
Content-Type: application/pgp-signature; name=signature.asc
Content-Disposition: attachment; filename=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (FreeBSD)

iD8DBQFFOAyBH31s/bvKrSQRArvYAKCE0RYAkNDA9RoxmnhW5Oyv5RXo8ACeND+D
rGVkycOK24zsChiT444clSY=
=Zhl1
-----END PGP SIGNATURE-----

--Sig_Cyq/M_VRFj9JZz0hTO.G8yt--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061020013833.35ae8f1b>