[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Command completion with * in the middle?
From: |
Peng Yu |
Subject: |
Re: [Help-bash] Command completion with * in the middle? |
Date: |
Tue, 22 Jan 2019 11:26:57 -0600 |
> > 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.
>
> Ooh, that's clever.
For some reason, this code does not work for me.
For example, when I type b*sh, then type TAB, it just clears up the
command line by deleting "*sh". I only end up with "b" in the command
line. Do you know what is wrong? Thanks.
--
Regards,
Peng
- [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, 2019/01/20
- 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 <=
- 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
- Re: [Help-bash] Command completion with * in the middle?, Peng Yu, 2019/01/28
- Re: [Help-bash] Command completion with * in the middle?, doark, 2019/01/26