Re: RFE: remove duplicate entries from the result of `compgen -W'
From:
Chet Ramey
Subject:
Re: RFE: remove duplicate entries from the result of `compgen -W'
Date:
Sun, 07 Sep 2014 13:07:00 -0400
User-agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
On 9/4/14, 10:33 PM, Clark Wang wrote:
> See following example:
>
> $ echo $BASH_VERSION
> 4.3.18(1)-release
> $ compgen -W 'hello hello' h
> hello
> hello
> $
>
> It'll be good if only one "hello" is outputted.
`complete' and `compgen' only generate lists of possible completions.
Readline performs duplicate removal when it is deciding what to do
with that list.
Chet
--
``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/