Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: subsitutions and beginning of lines.



On Oct 13,  2:42pm, Ray Andrews wrote:
}
} BTW, is there some way of asking history not to search
} thru a given number of entries, but to continue searching up to
} a given number of hits?

What defines a "hit" here?  Your "history" command isn't "searching"
AT ALL.  Rather it's your series of "grep" commands that are doing
the searching.  There's no way an argument to the "history" command
can tell it how many times "grep" of its output is going to succeed.

So it sounds like what you really want is

    eval history -r -n -$HISTSIZE $sstring | head $nnumber

That is, dump the entire history, grep it, and then show the most
recent few events that match the greps.




Messages sorted by: Reverse Date, Date, Thread, Author