#StackBounty: #bash #wildcards #autocomplete bash inputrc autocompletion with wildcards

Bounty: 200

I’ve adapted my inputrc with the following:

#Use tab to cycle through all the possible completions.
"t": menu-complete
"e[Z": menu-complete-backward

and when I have the following directory of server logs:

ATWIEUNXSRVFILE001
ATWIEWINSRVDOMA001
USLAXUNXSRVFILE001
USLAXWINSRVFILE001

I’d like autocompletion to cycle through all FILE servers. I.E.

$ analyze_logs *FILE*Tab

should cycle through

ATWIEUNXSRVFILE001
USLAXUNXSRVFILE001
USLAXWINSRVFILE001

(Where * obviously is some kind of wildcard/regex/anything, really…)

  • This has been bugging me for a few years already
  • I do have a few workarounds like
    • Alt+*
    • ls *FILE* > serverlist.txt
    • set show-all-if-ambiguous on
  • My google-fu seems to be abandoning me as I can’t find anything that does what I want.

If it helps, I’m definitely running bash (echo $0/bin/bash), on an arch-derivative but, if possible would like something portable across multiple *nix systems.


Get this bounty!!!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.