Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Use == in expressions instead of the deprecated =



2016-09-08 18:39:55 +0200, Mikael Magnusson:
[...]
> >> ksh93 also makes "==" obsolete in [[...]]. "==" is still not
> >> POSIX (and likely not going to be soon as requests to add it
> >> have been rejected (IIRC)) for the "test"/"[" utility (or expr).
> 
> POSIX doesn't have [[...]] so what it says isn't really relevant. [ a
> == b ] doesn't work in zsh by default either, you have to use either [
> a = b ] or [ a \== b ] and obviously the latter is pretty ridiculous.
> :)
[...]

I only said "==" was not POSIX *for the "test"/"[" utility (or
expr)*.

It's not relevant to [[...]] except that [[..]] was more or less
the "[" utility moved to a new shell construct to avoid some of
the issues with the interpretation of the arguments of the "["
command (most of which have later been fixed by POSIX).

Now, I agree, given that [ a == b ] doesn't work in zsh when not
in sh emulation, that's one more reason zsh maybe shouldn't
consider [[ a = b ]] as obsolete.

AFAICT, none of mksh, pdksh, yash, bash consider [[ = ]]
obsolete ([ = ] for yash which doesn't have [[ ]]).

-- 
Stephane



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