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

Re: Using history / fc for case-insensitive pattern matching



> On 22 February 2022 at 09:09 zzapper <zsh@xxxxxxxxxxxxxx> wrote:
> On 21/02/2022 21:01, Mikael Magnusson wrote:
> > On 2/21/22, Zach Riggle <zachriggle@xxxxxxxxx> wrote:
> >> I've written a neat little tool that wraps "fc" / "history" to make
> >> everything look neat and easily documentable for later reference /
> >> incident response.
> >>
> > You can use (#i) to make a pattern case insensitive, eg
> > fc -m '(#i)*zsh-u*'
> >
> > you may need to setopt extendedglob first.
> >
> Thanks Mikael for resolving this
> 
> (i needed the -nl)
> 
> fc -nl -m '(#i)*Mortg*'
> 
> but there's something clunky with the fc -m match .. I can't get to 
> match all of my history?

Try sticking a "1" at the end of the line to get the whole history.
It still does the match, but it now starts searching from the beginning.

pws




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