Importing mksh in base
Cy Schubert
Cy.Schubert at cschubert.com
Fri Jan 25 20:21:05 UTC 2019
In message <20190126064128.Y872 at besplex.bde.org>, Bruce Evans writes:
> On Fri, 25 Jan 2019, Gleb Popov wrote:
>
> > On Fri, Jan 25, 2019 at 8:58 PM Baptiste Daroussin <bapt at freebsd.org> wrote
> :
> >
> >> I would like to import mksh in base, https://www.mirbsd.org/mksh.htm
> >> And make it the default root shell (not necessary in one step)
> >>
> >> Why:
> >> 1/ it is tiny 400k (in the packaged version) all other shells fitting the
> >> expectation are bigger
> >> 2/ it's default frontend in interactive mode is very close to what most
> >> people
> >> are used to with bash
>
> You should warm up with a more modest task, such as replacing vi by emacs
> as the default editor.
>
> > Are there FreeBSD users that are used to bash? If not, this proposal looks
> > like another "let's do like Linux" thing.
>
> I have used /bin/bash as the root shell for more about 20 years. The
> currently install version is slightly newer -- only about 15 years old
> (bash-1.14.7(1) installed by mv'ing it from /usr/local/bin where some
> port put it.
That's a little risky unless it's static, which Bruce, I know you do.
>
> toor still uses csh, but I never use toor.
>
> I still use /bin/sh and of course /bin/ed for the single user shell and
> editing there, except on one system which is misconfigured with /usr
> on the root partition so that vi is accidentally available for editing.
> If need, I exec bin/bash from /bin/sh or mount /usr, but my /usr is
> usually on nfs and most boot-time editing is to fix network
> configuratation so that nfs is available.
This is my workaround. It avoids a lot of single-user grief. We used a
form of it on Solaris many moons ago.
case $(tty) in
/dev/console|/dev/ttyv?|/dev/ttyd?)
echo Using default shell of $SHELL
;;
*) if [ -x /usr/local/bin/bash ]; then
echo starting bash shell
OSHELL=$SHELL
SHELL=/usr/local/bin/bash
export SHELL
$SHELL < /dev/null && exec $SHELL
SHELL=$OSHELL
unset OSHELL
echo Unable to execute /usr/local/bin/bash or not
found, using default shell of $SHELL
fi
;;
esac
--
Cheers,
Cy Schubert <Cy.Schubert at cschubert.com>
FreeBSD UNIX: <cy at FreeBSD.org> Web: http://www.FreeBSD.org
The need of the many outweighs the greed of the few.
More information about the freebsd-arch
mailing list