In a bash completion script, suppose COMPREPLY=(aa/ba/ aa/bb/)
. When the script is invoked, the completion options looks like this to the user:
$ foo aa/b<TAB>
aa/ba/
aa/bb/
However, I want to have a bit more control over how these options are displayed. In particular, I want to show only a substring of each COMPREPLY option to the user, similar to how directory completion works in bash now:
$ foo aa/b<TAB>
ba/
bb/
Is there any way of doing this in bash?