[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
- [Help-bash] Command completion with * in the middle?, David Niklas, 2019/01/19
- Re: [Help-bash] Command completion with * in the middle?, Chet Ramey, 2019/01/20
- Re: [Help-bash] Command completion with * in the middle?,
Grisha Levit <=
- Re: [Help-bash] Command completion with * in the middle?, Chet Ramey, 2019/01/20
- Re: [Help-bash] Command completion with * in the middle?, Peng Yu, 2019/01/22
- Re: [Help-bash] Command completion with * in the middle?, Chet Ramey, 2019/01/22
- Re: [Help-bash] Command completion with * in the middle?, Peng Yu, 2019/01/22
- Re: [Help-bash] Command completion with * in the middle?, Chet Ramey, 2019/01/22
- Re: [Help-bash] Command completion with * in the middle?, Peng Yu, 2019/01/22
- Re: [Help-bash] Command completion with * in the middle?, Chet Ramey, 2019/01/22
- Re: [Help-bash] Command completion with * in the middle?, Peng Yu, 2019/01/22
- Re: [Help-bash] Command completion with * in the middle?, Koichi Murase, 2019/01/26
- Re: [Help-bash] Command completion with * in the middle?, Peng Yu, 2019/01/26