> Date: Wed, 30 Jul 2008 17:04:44 +0200
> From: Roland Mainz <roland.mainz at nrubsig.org>
> James Carlson wrote:
> > Roland Mainz writes:
> > > Does anyone know whether the "=="-operator for [[ ]] was...
> > > 1. ... already supported for ksh88 ?
> > > 2. ... documented for ksh88 (a grep over ksh(1) in Solaris 11/B84 does
> > > not list it) ?
> > 
> > Not sure how that grep was done, but I see this in the ksh(1) man page
> > for the old Solaris ksh:
> > 
> >      [[expression]]
> > 
> >          Evaluates expression and  returns  0  exit  status  when
> >          expression  is  true.  See Conditional Expressions for a
> >          description of expression.
> 
> To clarify:
> ksh88 and ksh93 allow two different operators to compare strings in [[
> ]], e.g ...
> 
> [[ "foo" = "foo" ]]
> 
>     and
> 
> [[ "foo" == "foo" ]]
> 
> ... but runing a lint (e.g. $ shcomp -n myscript.sh /dev/null #) says:
> -- snip --
> myscript.sh: warning: line 1: '=' obsolete, use '=='
> -- snip --
> ... for the 2nd form.
> 
> I assume this is just a documentation bug that ksh(1) in Solaris does
> not list "==" as allowed operator for string comparisations.

The change making the operator "==" equivalent to "=" in expressions
was made in the upgrade to ksh-88g in `93.  Apparently this change
was not reflected in the documentation.

                                                -JZ

Reply via email to