Subject: Re: Re: [ast-users] Cycling backwards through history with ctrl r?
--------

> On 17/01/2008, Thomas Magnusson <[EMAIL PROTECTED]> wrote:
> > Yes you can, with the difference that you have to push <return> after each.
> >
> > $ history
> > 47      cmd 1
> > 48      cmd 2
> > 49      cmd 3
> > 50      cmd 4
> > $ ^Rcmd<return>
> >
> > would fetch "cmd 4", then
> > $ ^R<return>
> >
> > would fetch "cmd 3"
> 
> How do I fetch "cmd 2"?
> 
> Wendy

The reason you need the new line with ^R is that ^R can be followed by
a string and it will search backward for the most recent line containing
that string (^R^string search for the most recent starting with string).

Thus, ^Rcmd 2 would search for cmd 2.  Also, you can go back N commands
with
        <ESC>-<N>^P
so that
        <ESC>3^P
would bring up cmd-2.

In vi control mode,
        <N>G
will bring up command N.
        

David Korn
[EMAIL PROTECTED]
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to