How can I implement incremental (find-as-you-type) search on command line?

Posted by florianbw on Stack Overflow See other posts from Stack Overflow or by florianbw
Published on 2010-04-22T11:22:25Z Indexed on 2010/04/22 17:53 UTC
Read the original article Hit count: 284

Filed under:

I'd like to write small scripts which feature incremental search (find-as-you-type) on the command line.

Use case: I have my mobile phone connected via USB, Using gammu --sendsms TEXT I can write text messages. I have the phonebook as CSV, and want to search-as-i-type on that.

What's the easiest/best way to do it? It might be in bash/zsh/Perl/Python or any other scripting language.

Edit: Solution: Modifying Term::Complete (http://search.cpan.org/~jesse/perl-5.12.0/lib/Term/Complete.pm) did what I want. See below for the answer.

© Stack Overflow or respective owner

Related posts about scripting