help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] Command completion with * in the middle?


From: Grisha Levit
Subject: Re: [Help-bash] Command completion with * in the middle?
Date: Sun, 20 Jan 2019 17:48:24 -0500

On Sat, Jan 19, 2019 at 11:54 PM David Niklas <address@hidden> wrote:

> Sadly, if there is such a way, I'm still searching for it...
>

I think something like this does the trick?

    f() { COMPREPLY=($(compgen -c -X '!'"$3")); }
    complete -I -F f -o bashdefault

i.e. generate all commands and then remove the ones that don't match the
pattern supplied.

    $ ?grep[TAB]
    egrep  pgrep
    fgrep  zgrep
    ggrep


reply via email to

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