On Wed, May 28, 2014 at 04:05:47PM -0400, Maarten Billemont wrote:
> 2a. One such case is doing pathname completion, but here we can fall back to
> compgen -o bashdefault:
>
> IFS=$'\n' read -r -d '' COMPREPLY < <(compgen -o bashdefault "$partial*") #
> notice the trailing *
I think you've taught me that I don't know a damned thing about bash
programmable completion.
imadev:~/tmp$ mkdir -p "dir "{1,2}
imadev:~/tmp$ echo dir*
dir 1 dir 2
imadev:~/tmp$ compgen -o bashdefault "di"
imadev:~/tmp$ compgen -o bashdefault "di*"
imadev:~/tmp$ compgen -o default "di"
dir 1
dir 2
imadev:~/tmp$ compgen -o default "di*"
imadev:~/tmp$ rmdir dir\ [12]
Sorry if I misunderstood the goal. Apparently, I don't understand the
compgen command either.
Good luck.