bash me, if you like

Rahul Siddharthan rsidd at online.fr
Tue Dec 9 20:00:29 PST 2003


Matthew Dillon wrote:
>    Bash (and sh) don't do interactive partial completion history
>    substitution.  At least, I don't think it does.
[snip]
>            bindkey -k up history-search-backward
>            bindkey -k down history-search-forward

You can do that in bash by putting the following in .inputrc

"\ep": history-search-backward
"\en": history-search-forward

(well, that binds to alt-p and alt-n, or esc p and esc n, I forget the
key bindings for arrow keys, but it should be easily found.)

As a bonus, you get the same key bindings in other readline-aware
applications, like gdb, octave, clisp etc.  

By default (more or less), bash and other readline applications have
^R and ^F for incremental reverse/forward history search, it works
slightly differently but easy to get used to.  But I use the above
because I moved from tcsh to bash.

Rahul





More information about the Kernel mailing list