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

ksh compatibility

> > According to the "Korn Shell Ref" card (updated for ksh93) from SSC
> > 
> > 	[[ str == pat ]]
> > 
> > is preferred  and 
> > 
> > 	[[ str = pat ]] 
> > 
> > is "obsolete" (but still works of course).
> > 
> > Can the == for [[ be added to zsh?  We've got some code that
> > needs to work on both ksh and zsh so it would be nice...
> My ksh manual from Solaris 5.4 (Last change: 3 Aug 1993) does not mention
> this, but I tried the ksh here, and it accepted the == syntax.  Here is a
> patch to zsh to do that.  This makes [[ ... = ... ]] and [[ ... == ... ]]
> equivalent.

Notice that he said ksh93.  I think Solaris uses ksh89.

Also, I will probably add this since I think == is a more logical way
of representing this.  But I must stress something important:

The goal of zsh is not to be a ksh clone.  The goal of zsh (as far as I'm
concerned) is to be a powerful superset of sh that is especially good at
interactive use.  The ksh compatibility we have now is more a matter of
convenience than the result of explicitly trying to copy ksh.  Maintaining
ksh compatibility for common commands is a good idea, but I see no compelling
reason to copy every last detail of ksh.

Richard Coleman

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