On 4/30/10 2:51 AM, jida...@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    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/


Reply via email to