Importing mksh in base

Edward Tomasz Napierała trasz at freebsd.org
Sat Jan 26 14:06:37 UTC 2019


On 0126T1138, Matthew Seaman wrote:
> On 25/01/2019 19:10, Eric van Gyzen wrote:
> > Ditto, except only 2 years on Linux before coming to FreeBSD.  I
> > tried tcsh, since it was the default and in base, but I hated it for
> > interactive use.  Notably absent are one-line “for" loops.  On new
> > installs, after networking is up, my very first command is “pkg
> > install bash [and others]”.
> I have the opposite experience.  I use tcsh as my interactive shell,
> mostly because I've used it for a long time and my fingers remember the
> command sequences.  If I'm using bash interactively I tend to get
> frustrated by not being able to type 'foo<Esc>p' to replay the last
> command starting 'foo'.  Yes, I know about <Ctrl>r but it just isn't the
> same.
> 
> If it's for programming though, it's straight to /bin/sh -- and I will
> admit to dropping into sh to write for-loops at the command prompt.
> 
> I'd be happy enough to see the default root shell changed to mksh.  I'd
> be pretty happy to see the root shell switched to our current /bin/sh
> for that matter.  Actually, what advantages does mksh have over /bin/sh?

I don't know mksh all that well, but two obvious areas where sh(1)
could be improved for interactive use are:

1. It does support history, but it doesn't support loading it from
   disk, nor writing it on exit.  I have a half-baked patch that adds
   it, if anyone's interested.

2. The tab completion works fine for paths, but not for commands.
   So, for example if you type 'camc<tab>', it won't get completed,
   while 'vi /etc/rc.c<tab>' will work.



More information about the freebsd-arch mailing list