Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2
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.
Franta