Bash: autocomplete from list

Hal Burgiss hal at burgiss.net
Sun Aug 1 13:46:08 UTC 2010


On Sun, Aug 1, 2010 at 9:22 AM, Luis Paulo <luis.barbas at gmail.com> wrote:
> On Sun, Aug 1, 2010 at 1:23 AM, Afsheen Ghorashy <grasswistle at gmail.com> wrote:
>> Let us assume that I have a text file with expressions separated by line
>> breaks.
>>
>> I would like Bash to include the expressions of this text file in its search
>> when I press double-tab (autocomplete).
>>
>> Is this possible? How would I do it? Programming is no foe of mine.
>>
> Nah...
>

It would be worth looking at some programmable completion tutorials.
Programmable completion  is available with bash and allows for
customizing the completion options. Its pretty flexible.

http://tldp.org/LDP/abs/html/tabexpansion.html

-- 
Hal




More information about the ubuntu-users mailing list