This question is less perl related, but I believe relevant to many monks here.

I have a script that acts on any number of files in a particular directory, and I frequently find myself typing the name of the script, space, tab tab, and seeing the files in the directory i'm in, harrumph! What I'd really like is to emulate the bash tabbing features, but have my script do the "deciding" on what should be shown. Is there a way to override the "tabbing" in bash to call my script with a special parameter indicating that i want tab completion features to run (and pass in my partially typed argument so it can do this properly).

I hope this is phrased properly, need clarification?

It's not what you look like, when you're doin' what you’re doin'.
It's what you’re doin' when you’re doin' what you look like you’re doin'!
     - Charles Wright & the Watts 103rd Street Rhythm Band, Express yourself

2006-08-24 Retitled by holli, as per Monastery guidelines
Original title: 'Bash Tabbing'


In reply to (OT) Bash Tabbing by qbxk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.