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.

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)

Reply via email to