You normally interact with bash completion by pressing the tab
key in your terminal. I would like to interact with it within a script of mine. Essentially, I would like a function/command that answers the question "If I pressed tab
with text xyz already typed and the cursor as position n, what would be the suggestions?"
Does this function exist? I found compgen
but it's poorly documented and doesn't seem to do what I want.