Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Jan 2019 12:20:57 -0800
From:      Cy Schubert <Cy.Schubert@cschubert.com>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        Gleb Popov <arrowd@freebsd.org>, arch@freebsd.org, Baptiste Daroussin <bapt@freebsd.org>
Subject:   Re: Importing mksh in base
Message-ID:  <201901252020.x0PKKv3N049433@slippy.cwsent.com>
In-Reply-To: Message from Bruce Evans <brde@optusnet.com.au> of "Sat, 26 Jan 2019 06:53:11 %2B1100." <20190126064128.Y872@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20190126064128.Y872@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@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@cschubert.com>
FreeBSD UNIX:  <cy@FreeBSD.org>   Web:  http://www.FreeBSD.org

	The need of the many outweighs the greed of the few.





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