tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: mksh import

On Thu, 30 Dec 2010 08:43:16 -0500
Thor Lancelot Simon <> wrote:

> On Thu, Dec 30, 2010 at 10:17:42AM +0100, Adam Hamsik wrote:
> > Hi folks,
> > 
> > I think that it would be good to have at least one modern shell in
> > our base, because I use ksh and it's de facto standard I have decided
> > to make a patch which adds mksh[1] to our base [2]. Code is BSD
> > licensed, well written and maintained which can't be said about our own
> > ksh(There are 15 PRs opened for it).
> This would be fine with me if the other ksh in our tree were removed.
> When our ksh was imported, it was *supposed* to replace our /bin/sh.
> But as it turned out, it was so buggy it couldn't (it was much further
> from POSIX compliance than our /bin/sh).

I had patches in my personal tree for replacing ksh with mksh, and
I have used my system with the replaced shell for a very long time.
> Do you think it would be possible to use mksh to carry out our original
> long ago plan of simply replacing the current /bin/sh, and enhance
> functionality while trimming down the system at the same time?

MirBSD (the project where mksh comes from) uses mksh as /bin/sh, and
AFAIK it works out pretty well.

> Another question is performance.  Some shells are much much faster than
> others for tasks like system builds.  For example, zsh can actually
> speed up the build considerably if used to replace our /bin/sh, while
> our in-tree "ksh" is about the same or a little slower.  How does mksh
> compare?

mksh is derived from pdksh, which is the same ksh we currently have,
so i dont think it has dramatically different performance characteristics.

> Can enough ksh functionality be turned off in mksh to leave a comfortable
> environment for those used to a fairly minimal shell like our current
> /bin/sh?  Can it be made entirely compatible with script (I'm mostly
> thinking .profile) syntax for our existing shell?
> Thor

Yes, it has a build time option to configure as a "small shell".
I used it in my embedded NetBSD environment I have made for my arm board.

NetBSD - Simplicity is prerequisite for reliability

Home | Main Index | Thread Index | Old Index