Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Using history / fc for case-insensitive pattern matching
- X-seq: zsh-users 27533
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Using history / fc for case-insensitive pattern matching
- Date: Tue, 22 Feb 2022 09:27:51 +0000 (GMT)
- Archived-at: <https://zsh.org/users/27533>
- Importance: Medium
- In-reply-to: <c63f1026-ea3b-4ee8-f45b-1358aac1897d@rayninfo.co.uk>
- List-id: <zsh-users.zsh.org>
- References: <CAMP9c5n=NQ6myLatuLTcNJ71PxDdTqGMbPrDArPVSABOskmiqA@mail.gmail.com> <CAHYJk3T0zPzxP9jB=F=3_CH+f7ewr0mWJTHeZX9a2P+Adztu8w@mail.gmail.com> <c63f1026-ea3b-4ee8-f45b-1358aac1897d@rayninfo.co.uk>
> 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