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:47 zzapper <zsh@xxxxxxxxxxxxxx> wrote:
> # pws: yes thanks the following works
> >
> > fc -l -m '(#i)*Mortg*' 1
> >
> >
> > (should this be documented?)
> >
> > zzapper
> >
> >
> To answer my own question: with fc any number range eg first last 
> should/must be the last

Would this be a little clearer?  History (pun intended) shows that
making the docs more verbose doesn't mean people necessarily find
them clearer, but I think they are particularly terse at this point.

pws

diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo
index c7de50f..dbb787f 100644
--- a/Doc/Zsh/builtins.yo
+++ b/Doc/Zsh/builtins.yo
@@ -756,15 +756,16 @@ specifies the most recent event beginning with the given string.  All
 substitutions var(old)tt(=)var(new), if any, are then performed on the
 text of the events.
 
-In addition to the number range,
+The range of events selected by numbers can be narrowed further by the
+following flags.
 startsitem()
 sitem(tt(-I))(restricts to only internal events (not from tt($HISTFILE)))
 sitem(tt(-L))(restricts to only local events (not from other shells, see
 tt(SHARE_HISTORY) in ifzman(zmanref(zshoptions))\
 ifnzman(noderef(Description of Options)) -- note that tt($HISTFILE) is
 considered local when read at startup))
-sitem(tt(-m))(takes the first argument as a pattern (should be quoted) and
-only the history events matching this pattern are considered)
+sitem(tt(-m))(takes the first argument as a pattern (which should be
+quoted) and only the history events matching this pattern are considered)
 endsitem()
 
 If var(first) is not specified, it will be set to -1 (the most recent




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