From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gatech.edu (gatech.edu [130.207.244.244]) by werple.net.au (8.7/8.7) with SMTP id WAA18793 for ; Thu, 12 Oct 1995 22:35:20 +1000 (EST) Received: from gauss (gauss.skiles.gatech.edu) by gatech.edu with SMTP id AA02776 (5.65c/Gatech-10.0-IDA for ); Thu, 12 Oct 1995 08:28:27 -0400 Received: by gauss (5.x/SMI-SVR4) id AA29914; Thu, 12 Oct 1995 08:27:59 -0400 Resent-Date: Thu, 12 Oct 1995 13:07:41 +0100 (MET) Old-Return-Path: From: Zoltan Hidvegi Message-Id: <199510121207.NAA13791@bolyai.cs.elte.hu> Subject: Re: [[ str == pat ]] ? To: glenn@mathcs.emory.edu Date: Thu, 12 Oct 1995 13:07:41 +0100 (MET) Cc: zsh-workers@math.gatech.edu (zsh-workers) In-Reply-To: <199510120542.BAA08305@drella.mathcs.emory.edu> from "Glenn Barry" at Oct 12, 95 01:42:33 am X-Mailer: ELM [version 2.4 PL24] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-Id: <"cdnU6.0.KJ7.EdGVm"@gauss> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/451 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu 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... 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. Could you post your ksh documentation? Cheers, Zoltan *** 1.4 1995/10/10 18:24:53 --- Src/parse.c 1995/10/12 11:30:30 *************** *** 1320,1326 **** Cond n = (Cond) make_cond(); int t0; ! if ((b[0] == Equals || b[0] == '=') && !b[1]) n->type = COND_STREQ; else if (b[0] == '!' && (b[1] == Equals || b[1] == '=') && !b[2]) n->type = COND_STRNEQ; --- 1320,1327 ---- Cond n = (Cond) make_cond(); int t0; ! if ((b[0] == Equals || b[0] == '=') && ! (!b[1] || ((b[1] == Equals || b[1] == '=') && !b[2]))) n->type = COND_STREQ; else if (b[0] == '!' && (b[1] == Equals || b[1] == '=') && !b[2]) n->type = COND_STRNEQ; *** 1.4 1995/10/10 20:13:12 --- Doc/zshmisc.1 1995/10/12 12:05:23 *************** *** 997,1003 **** --- 997,1007 ---- .I file2 exist and refer to the same file. .TP + .PD 0 + \fIstring\fP \fB==\fP \fIpattern\fP + .TP \fIstring\fP \fB=\fP \fIpattern\fP + .PD true if .I string matches