Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Nov 2004 17:05:28 +0100
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        Avleen Vig <lists-freebsd@silverwraith.com>
Cc:        Kevin Lyons <klyons@corserv.com>
Subject:   Re: tcsh fix
Message-ID:  <20041112160528.GA91711@falcon.midgard.homeip.net>
In-Reply-To: <20041112055543.GH19417@silverwraith.com>
References:  <41940880.7070409@corserv.com> <20041112023023.GG19417@silverwraith.com> <20041112031122.GA87071@falcon.midgard.homeip.net> <20041112055543.GH19417@silverwraith.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Nov 11, 2004 at 09:55:43PM -0800, Avleen Vig wrote:
> On Fri, Nov 12, 2004 at 04:11:22AM +0100, Erik Trulsson wrote:
> > Personally I am of the opinion that csh (all versions) should be
> > removed completely from the base system and relegated entirely to the
> > ports system. Other than historical reasons there is not much point in
> > having it in the base system.
> 
> I strongly disagree. csh and sh should be 'pure' versions. That is to
> say, no matter what shell is actually being called as sh or csh, it
> should provide a 100% compatible version, no differences, no "upgrades".

100% compatible with WHAT?!?  Remember that even 'classic' csh went
through several versions, and I very much doubt that the last version
was 100% compatible with the first version.
sh has gone through even more upgrades over the years.
For /bin/sh there is a Posix standard which says what minimum set of
features it should have.  Following this standard makes /bin/sh look
much more like the Korn shell than the original Bourne shell.

> This is to provide compatibility whn working with multiple versions of
> Unix.
> I write many scripts in sh on Solaris, and find they just don't work on
> Linux because /bin/sh on Linux is really /bin/bash and is not bacwards
> compatible. I HATE this. We shouldn't do this, and should do anything
> like this.

Again - backwards compatible with what?  Might it not be the case that
it is your scripts for Solaris-sh which uses non-standard features and
therefore fails on bash (which actually tends to be very
standards-compliant.)

> 
> > (Originally csh was created to get a shell with better interactive
> > features the original Bourne shell and tcsh is much better for
> > interactive use than 'classic' csh - indeed a modern /bin/sh is better
> > than 'classic' csh.  For writing scripts the Bourne-derivatives is much
> > better than csh and it has long been strongly recommended that one
> > should not write scripts for csh. One cannot even assume that
> > all systems have csh installed - Posix doesn't require it but it does
> > require /bin/sh to be present.) 
> 
> and /bin/sh should be classic /bin/sh not some version which is going to
> break my shit when I port it over! I'm so glad this is the case with
> FreeBSD :-)

But it isn't.  /bin/sh is much improved and enhanced over 'classic'
/bin/sh (as found in, say v6 Unix.)
Going back to the original Bourne shell would not be fun.

ash (the shell FreeBSD uses for /bin/sh) is much a "real" /bin/sh as
tcsh is a "real" /bin/csh.


> > 'csh' does run pure csh, and nothing else. The latest version of csh
> > which happens to be renamed to tcsh to be exact.  That this latest
> > version is not 100% compatible with earlier versions might be
> > unfortunate but very few software packages never break backwards
> > compatibility.
> 
> How about when working with multiple versions of the same shell on
> different OS's? surely you can see the problem there.

If you have to write scripts that need to work with many different
shell-implementations - each with its own set of bugs - you will simply
have to write your scripts so as to avoid those things which differ
between the implementations.
The other option is to write your scripts so that they work according
to some relevant standard and file bug-reports for those shells which
do not implement the standard correctly.

> 
> > > 'sh' should be pure sh, not what Linux does and bastardize it as
> > > /bin/bash
> > 
> > There is no such thing as "pure sh".  It you believe otherwise please
> > tell us what you think such a shell would look like and exactly what
> > features should be in it.
> > (Hint: Current standards require /bin/sh to have several features that
> > were not available on early Unix versions.)
> 
> Then we should follow current standards. Not pretend one shell is
> another!

Following current standards means that we cannot have a 'classic'
/bin/sh.  Following current standards mean that Linux can have bash
installed as /bin/sh.

> 
> > > If someon wants a more powerful shell, they can install it themselves.
> > 
> > Keep in mind that FreeBSD's /bin/sh is a more powerful shell than was
> > available in, say, v7 Unix.
> 
> Yes but AFAIK it's compatible in every way I've tried with say, Sun's
> /bin/sh, and I've tried some pretty complex shell scripts.

Sun's /bin/sh has also been enhanced in many ways (mostly for
Posix-compliance I would think, same as FreeBSD's /bin/sh.)



-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se



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