[wplug] smart command history?

John Harrold jmh17 at pitt.edu
Tue Feb 24 18:00:03 EST 2004


Sometime in February Brandon Kuczenski assaulted the keyboard and produced:

| So everyone knows one can select from previously-entered commands by 
| pressing up-arrow in a terminal.  And tab-completion can help one fill out 
| a partially typed command.  I was wondering if anyone was familiar with 
| 'Matlab-style' command history for a *sh terminal.  The way Matlab does it 
| is: if you have a partially typed command, then up-arrow will only fill-in
| previously-entered commands that match the partially-typed string.  For 
| example, if one had entered a command like 'chmod a-w *' and then entered 
| some other commands, navigating around and such, then if the one entered 
| 'ch' and pressed up-arrow, it would cycle through only commands beginning 
| with 'ch', rather than all recently-entered commands.
| 
| One can imagine how this would be useful.
| 
| I could imagine a way to do this by searching through the .bash_history 
| file, but I think that file only gets written to on logout. Besides, I 
| wouldn't know how to hook it into bash.

bash has something like this. twpe ctrl+r then type 'ch'


-- 
--------------------------------------------------------------------------
                                               | /"\
 john harrold                                  | \ / ASCII ribbon campaign
      jmh at member.fsf.org                    |  X  against HTML mail
           the most useful idiot               | / \
--------------------------------------------------------------------------
 What difference does it make to the dead, the orphans, and the homeless,
 whether the mad destruction is brought under the name of totalitarianism or
 the holy name of liberty and democracy?
 --Gandhi
--------------------------------------------------------------------------
gpg --keyserver keys.indymedia.org --recv-key F65A739E
--------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://penguin.wplug.org/pipermail/wplug/attachments/20040224/66199beb/attachment-0001.bin


More information about the wplug mailing list