From owner-freebsd-standards@FreeBSD.ORG Sat Apr 3 16:02:05 2010 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D5ED106564A for ; Sat, 3 Apr 2010 16:02:05 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 253F58FC08 for ; Sat, 3 Apr 2010 16:02:05 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 32D061DD41A; Sat, 3 Apr 2010 18:02:04 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 2572B17522; Sat, 3 Apr 2010 18:02:04 +0200 (CEST) Date: Sat, 3 Apr 2010 18:02:04 +0200 From: Jilles Tjoelker To: Nathan Weeks Message-ID: <20100403160203.GA19283@stack.nl> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-standards@freebsd.org Subject: Re: /bin/sh vi-mode command line editing pathname expansion X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Apr 2010 16:02:05 -0000 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. > = > Display the possible shell word expansions (see wordexp ) > of the bigword at the current command line position... > \ > Perform pathname expansion (see Pathname Expansion ) > on the current bigword, up to the largest set of characters > that can be matched uniquely... > * > Perform pathname expansion on the current bigword and > insert all expansions into the command to replace the current > bigword, with each expansion separated by a single ... > 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 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