Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Oct 1998 20:21:02 -0500 (EST)
From:      Chuck Robey <chuckr@mat.net>
To:        "Kurt D. Zeilenga" <Kurt@OpenLDAP.Org>
Cc:        current@FreeBSD.ORG
Subject:   Re: Changing sh for compatibility sake
Message-ID:  <Pine.BSF.4.05.9810262002240.2963-100000@picnic.mat.net>
In-Reply-To: <3.0.5.32.19981026163758.009dd550@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 26 Oct 1998, Kurt D. Zeilenga wrote:

> FreeBSD sh is not the lowest common denominator.

I'm sorry, that's not true.  Ask anyone who writes shell scripts that
install software (or perform any necessarily portable function) across
multiple platforms.  sh is the shell to use ONLY BECAUSE it's the lowest
common denominator.  Why else would they use the dumbest shell?

People use sh because it's the most likely to be universally available.
It may seem strange, but it's certainly true, and if you write your
scripts using sh, they'll just work anywhere (stepping over the problem
of a badly written script ab initio).

Please understand, I'm not talking user shells, I'm talking sysadmin and
installer type shells, which means sh, and only sh.  No 2nd choice.  
Have you ever seen an installer script written by a company that
*didn't* supply the entire OS, be written in any shell BUT sh?

> Neither is bash.
> Neither is pdsh.  Neither is ksh or whatever your favorite shell is.
> They are all factors of the lowest common denominator.

That's true of user shells, it's NOT TRUE for sh, which is unique.
All the other shells (including the one I like) are for us users;
sh is for sysadmins and installer-writers.  You don't think I use sh, do
you?  I use tcsh, which I wouldn't dream of suggesting be used to
replace sh.  Likewise bash (which is a great shell), likewise scsh, etc.

The only reason I saw for putting forward pdksh was because it boasted
100% sh compatibility, it IS being actively developed (new versions
still coming out with  bug-fixes), and it's smaller (as far as static
image) than sh.  I was never, ever referring to it's larger,
non-compatible-to-sh extensions.  If they didn't come without changing
the sh compatibility, they weren't worth it.  Extra features are a
distraction here, and shouldn't be part of the discussion.  The point
isn't choosing a user shell, it's choosing *sh*, which IS UNIQUE, and
must remain so.

We use ash now for sh (no, we don't use the original sh code, that's
AT&T code).

> 
> Changing FreeBSD sh to something else will:
> 	1) not improve the portability of existing scripts.  In fact,
> 	the change can only decrease portability of existing scripts.
> 
> 	2) not change the lowest common denominator for script
> 	developers.  That is, FreeBSD sh will still be in use and,
> 	hence, will still be a factor.  Even if the target is
> 	just FreeBSD, both old and new shells would be factors.
> 	This change can only add new factors to the lowest
> 	common denominator.

but sh *is* the lcd!  You can't change the lcd, you can only match it
more closely, and that's the single *only* reason I considered pdksh, in
just that light.

> 
> Changing the sh for compatibility sake does not make much sense.
> If you are going to change sh, do it for functionality sake... just
> make sure the functionality gain is worth the resulting portability
> losses.
> 
> Kurt
> 
> 
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-current" in the body of the message
> 
> 

----------------------------+-----------------------------------------------
Chuck Robey                 | Interests include any kind of voice or data 
chuckr@glue.umd.edu         | communications topic, C programming, and Unix.
213 Lakeside Drive Apt T-1  |
Greenbelt, MD 20770         | I run Journey2 and picnic (FreeBSD-current)
(301) 220-2114              | and jaunt (NetBSD).
----------------------------+-----------------------------------------------





To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9810262002240.2963-100000>