lskatz has asked for the wisdom of the Perl Monks concerning the following question:

Hi Perl Monks,
I have a wrapper Perl script which takes one of many preselected parameters, e.g. "one" or "parameterFiveHundred" or "whiteHouse." How can I use Linux's ability to find a correct parameter using tab?

I know that you can push tab to autocomplete a file path, or in the case of apt-get, it will autocomplete "install," and so I know this is possible on some level. Thank you for your help.

Replies are listed 'Best First'.
Re: Linux tab autocomplete
by chrestomanci (Priest) on Feb 08, 2011 at 17:12 UTC

    Assuming you have configured bash as your linux shell (It has been the default under most distros for ages), then the config you want will be under /etc/bash_completion.d/

    In there you will find a collection of shell scripts that bash uses to guess what you mean when you hit tab. A google search on "bash autocomplete" should find you some tutorals on how to write one of these scripts.

Re: Linux tab autocomplete
by Perlbotics (Archbishop) on Feb 08, 2011 at 18:45 UTC