Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 3
    Your function is not making any use of the partial word being completed, which should be in ${COMP_WORDS[$COMP_CWORD]}. Commented Feb 1, 2018 at 3:49
  • So, I should filter my results to only show those that match what was typed? I.e. I would use something like: word="${COMP_WORDS[$COMP_CWORD]}" and then only add to my output array those elements that start with $word? Commented Feb 1, 2018 at 4:47
  • That, in fact was what I needed to do! Thanks for your help. If you wan to put your comment in the form of an answer, I will accept that as the solution. Thanks again! Commented Feb 1, 2018 at 4:53
  • 1
    It would be better if you posted how you fixed the function using that as an answer! Commented Feb 1, 2018 at 5:03
  • I did edit my post above. Should I post it as a separate answer? Thanks again for your help. This had me spinning for a few days! Commented Feb 1, 2018 at 5:04