On Tue, Sep 13, 2022 at 02:05:28PM -0600, Todd C. Miller wrote:
> On Tue, 13 Sep 2022 19:26:47 -0000, Klemens Nanni wrote:
> 
> > install.sub uses [[ foo == f*o ]] extensively, yet ksh(1) only documents
> > pattern matching for the = and != operators.
> 
> Think of the wasted bytes in install.sub!

We should switch from ksh to K or J to save even more bytes, then
install.sub^W^W^Wi will truly be unreadable.

I imagine almost every diff to i would then be a three-line diff...

> 
> > Just like with [, = and == behave the same in [[ last time I checked.
> >
> >     $ [[ foo = f*o ]] && echo match
> >     match
> >     $ [[ foo == f*o ]] && echo match
> >     match
> >
> > Feedback? OK?
> 
> This is correct, though I'd prefer if the single "=" came first to
> match the order given in the operators section.  E.g.
> 
> The second operand of the
> .Sq = ,
> .Sq ==
> and
> .Sq !=
> expressions are patterns (e.g. the comparison
> 
>  - todd
> 

Sure.


Index: ksh.1
===================================================================
RCS file: /cvs/src/bin/ksh/ksh.1,v
retrieving revision 1.216
diff -u -p -r1.216 ksh.1
--- ksh.1       31 Mar 2022 17:27:14 -0000      1.216
+++ ksh.1       13 Sep 2022 20:09:54 -0000
@@ -745,9 +745,10 @@ Operators (e.g.\&
 must be unquoted.
 .It
 The second operand of the
-.Sq !=
+.Sq = ,
+.Sq ==
 and
-.Sq =
+.Sq !=
 expressions are patterns (e.g. the comparison
 .Ic [[ foobar = f*r ]]
 succeeds).

Reply via email to