Le Sat, 18 Jan 2020 20:06:54 +0100,
František Kučera <address@hidden> a écrit :
> Dne 09. 01. 20 v 21:17 kaycee gb napsal(a):
> > After playing with options for complete -b/-c, compgen -b/-c, these
> > commands are still displayed when I type first 2 letters then <TAB><TAB>
> >
> > # sh<TAB><TAB>
> > shift shopt show
> >
> > I want that it matches just the last one.
>
> Hello,
>
> I am dealing with a similar issue. I need a bash-completion that suggest only
> commands from a special path variable (similar to $PATH, may also contain
> multiple directories) and I need to get rid of shell builtins and function
> names i.e. return only executable files on my path.
>
> My current solution is:
>
> while read c; do PATH="$MY_PATH" type -P "$c" &>/dev/null && echo $c; done <
> <(PATH="$MY_PATH" compgen -A command -- "$input")
>
> It is bit complicated but does exactly what I need.
Yes it seems a bit more complicated than mine ^^
At which level do you insert your code ?
>
> Franta
>
>
>
>