Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Apr 2010 12:07:00 -0500
From:      Nathan Weeks <weeks@iastate.edu>
To:        Jilles Tjoelker <jilles@stack.nl>
Cc:        freebsd-standards@freebsd.org
Subject:   Re: /bin/sh vi-mode command line editing pathname expansion
Message-ID:  <s2w8f47e3001004081007g9beb3836s8402a534df8f38e3@mail.gmail.com>
In-Reply-To: <20100403160203.GA19283@stack.nl>
References:  <q2x8f47e3001004020722k91dc69cw5157fb0438e5244c@mail.gmail.com> <20100403160203.GA19283@stack.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Apr 3, 2010 at 10:02 AM, Jilles Tjoelker <jilles@stack.nl> wrote:
> On Fri, Apr 02, 2010 at 08:22:56AM -0600, Nathan Weeks wrote:
>> The following vi-mode command line editing features seem to be
>> missing from FreeBSD 8.0's /bin/sh.
>
>> =3D
>> =A0 =A0 Display the possible shell word expansions (see wordexp )
>> =A0 =A0 of the bigword at the current command line position...
>> \
>> =A0 =A0 Perform pathname expansion (see Pathname Expansion )
>> =A0 =A0 on the current bigword, up to the largest set of characters
>> =A0 =A0 that can be matched uniquely...
>> *
>> =A0 =A0 Perform pathname expansion on the current bigword and
>> =A0 =A0 insert all expansions into the command to replace the current
>> =A0 =A0 bigword, with each expansion separated by a single <space>...
>
>> Full descriptions are here:
>
>> http://www.opengroup.org/onlinepubs/9699919799/utilities/sh.html
>
> "bigword" is not good: it disallows file name completion with spaces
> (unless we implement ksh-like $'quoting' and put in $'\040' for a
> space, which is ugly).
>
>> This would be handy to have out-of-the-box so one doesn't have
>> to install bash or ksh to have a POSIX shell that can do this kind
>> of pathname expansion in an interactive shell.
>
> NetBSD has file name completion in sh/libedit (optionally with <Tab> as
> people expect) but I think it is still a bit too simplistic: it does not
> quote spaces and the like. Because not doing this quoting is highly
> surprising in a negative way and other shells I've tried (bash, zsh,
> ksh93, mksh) do it, I think it is a requirement.
>
> If stefanf@ (de facto libedit maintainer) ports over the NetBSD code and
> someone takes care of the quoting issue, I would not be opposed to it.
>
> A more general question is how far we should go with this kind of
> features. Our /bin/sh is not bash or zsh and probably should not be.
> Unfortunately, this means that people who want a good interactive
> Bourne-style shell have to resort to ports/packages and install bash,
> zsh, mksh or possibly ksh93. I don't think non-embedded operating
> systems based on FreeBSD should default to /bin/sh as a shell for users.
>
> --
> Jilles Tjoelker
>

That all sounds reasonable. If this were implemented, there would be less
incentive to for me to install bash or ksh in every jail.

--=20
Nathan Weeks



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