Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Jan 2012 23:16:30 +0100
From:      Jilles Tjoelker <jilles@stack.nl>
To:        Matthew Story <matthewstory@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: intent of tab-completion in /bin/sh in 9.0
Message-ID:  <20120118221630.GA97471@stack.nl>
In-Reply-To: <CAB%2B9ogffj6XOTrJrZACVUdzoJTnBf6s03up3N%2BpSC4_71V2=Jg@mail.gmail.com>
References:  <CAB%2B9ogffj6XOTrJrZACVUdzoJTnBf6s03up3N%2BpSC4_71V2=Jg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jan 18, 2012 at 11:00:44AM -0500, Matthew Story wrote:
> Just noticed that tab-completion in /bin/sh has been added in 9.0
> (verified that it is not there in 8.0, dunno if it's there in 8.2,
> could probably go digging to figure it out).  In addition to the
> command history via <up>:<down> (which is present in 8.0) FreeBSD sh
> is now actually a pretty usable interactive shell.  I also noticed
> that the following bit has been removed from the sh(1):

>  This version has many features which make it appear similar in some
> respects to the Korn shell, but it is not a Korn shell clone like pdksh.

That sentence is an implicit comparison to the Bourne shell. When it was
written, many other Un*x variants had a version of the Bourne shell as
/bin/sh, and it was not taken for granted to have things like $(...),
$((...)) and ${...#...} in a /bin/sh. Nowadays, this is often taken for
granted; the last OS to have a Bourne shell as /bin/sh is probably
Solaris 10 (11 has ksh93).

On the contrary, our /bin/sh is minimalistic compared to many other
shells used in that role, like bash, pdksh, mksh and ksh93. It (the 9.0
version) has only slightly more features than dash or NetBSD's sh, and
dash has instead some other features.

> Just wondering if the general direction here is attempting to provide a
> minimal POSIX shell, that is useful enough interactively to become the
> default root shell (supplanting csh)?  Or if there is just a general trend
> towards adopting more of the ksh feature-set.

POSIX itself has gradually adopted ksh features, so seeing more of them
in future is not unlikely. Most of the new language features in 9.0 are
either from POSIX.1-2008 or on the roadmap for a new version of POSIX
(in collaboration with other shell authors).

Adding other ksh features is not very likely.

It is certainly possible to use /bin/sh as root's shell, but the
distributed master.passwd entry will probably continue to use /bin/csh
for a long time.

Some plans for sh in 10.0 are in this mailing list post:
http://lists.freebsd.org/pipermail/freebsd-arch/2011-December/011976.html

-- 
Jilles Tjoelker



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