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

Re: [[ str == pat ]] ?



 Zoltan> Glenn Barry wrote:
 >> most excellant zsh workers,
 >> 
 >> 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...

 Zoltan> My ksh manual from Solaris 5.4 (Last change: 3 Aug 1993) does
 Zoltan> not mention this, but I tried the ksh here, and it accepted
 Zoltan> the == syntax.  Here is a patch to zsh to do that.  This
 Zoltan> makes [[ ... = ... ]] and [[ ... == ... ]] equivalent.

 Zoltan> Could you post your ksh documentation?

Sure, it's the "KORN SHELL REFERENCE" card by arnold robbins for
Specialized Systems Consultants, Inc (Seattle, WA, USA) at
sales@xxxxxxxx  It describes both ksh88 and ksh93.  It's color coded
so the ksh93 stuff is in blue ... nicely done, btw.  Zsh could use one
of these ... richard, if you want to do one of these for zsh then
contact arnold (arnold@xxxxxxxxxxxxxxxx) and/or SSC at the above
address. (i have no biz interest in this, btw)

The card says

	string = pattern 
		true if string matches pattern 
		quote any part of pattern to treat 
			it as a string; *obsolete in ksh93*

	*string == pattern*
		*same as = (preferrred in ksh93)*

(coded *blue* for ksh93)
	
Arnold consulted with dave korn on the ref card so i bet it's correct
:).

Note the ksh with solaris 2.4 is ksh88i but if you have cde, then
dtksh is ksh93 w/motif extensions.

glenn






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