bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: completion gobbles partial match string


From: Chet Ramey
Subject: Re: completion gobbles partial match string
Date: Sat, 01 May 2010 17:46:56 -0400
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.7) Gecko/20100111 Lightning/1.0b1 Thunderbird/3.0.1

On 4/30/10 2:51 AM, jidanni@jidanni.org wrote:
> Put the cursor after the word "list" and hit TAB:
> # find /etc/apt/sources.list.d/*list #|cpio -o|ssh 192.168.44.4 cpio -ivdm
> Emacssources.list  eeepc.list         tw.list
> # find /etc/apt/sources.list.d/ #|cpio -o|ssh 192.168.44.4 cpio -ivdm
> 
> Notice how we are shown the completions, but then the "*list" has been
> gobbled up!
> BASH_VERSION='4.1.5(1)-release'

Yep.  Readline relies on matching prefixes: if there are multiple
completions, it replaces the word to be completed with the longest
common prefix.  In this case, there isn't one.

The builtin bash completion won't perform replacement when a globbing
pattern expands to more than one filename, even when they share a common
prefix.  I have to assume that you're using programmable completion,
and the compspec for `find' doesn't impose the same restriction.
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]