From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gatech.edu (gatech.edu [130.207.244.244]) by werple.mira.net.au (8.6.12/8.6.9) with SMTP id MAA06845 for ; Wed, 16 Aug 1995 12:04:40 +1000 Received: from math (math.skiles.gatech.edu) by gatech.edu with SMTP id AA24689 (5.65c/Gatech-10.0-IDA for ); Tue, 15 Aug 1995 22:02:58 -0400 Received: by math (5.x/SMI-SVR4) id AA12924; Tue, 15 Aug 1995 21:57:58 -0400 Resent-Date: Wed, 16 Aug 1995 03:48:54 +0200 (MET DST) Old-Return-Path: Message-Id: Subject: Re: hzoli change: $foo:s//r/ To: hzoli@cs.elte.hu (Zoltan Hidvegi) Date: Wed, 16 Aug 1995 03:48:54 +0200 (MET DST) Cc: zsh-workers@math.gatech.edu In-Reply-To: <9508151702.AA18359@turan.elte.hu> from "Zoltan Hidvegi" at Aug 15, 95 07:02:04 pm From: Thorsten Meinecke Organization: none. Location: Berlin, Germany X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-Id: <"aIBVo2.0.s93.b2LCm"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/319 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu In article "archive/latest/313", Zoltan Hidvegi wrote: > Anthony Heading wrote: > > hzoli changelog of Jul 10 says: > > - $foo:s//r/ gives ... error message ... (194) > > > > Now the following used to work > > > > % array=(a b c d e) > > % echo $array:s//\&-\&/ > > a-a b-b c-c d-d e-e > Maybe we can find an other syntax for that. In plain unmodified hzoli10.3 the unadorned backslash does exactly that. $ ./zsh -fc 'echo $ZSH_VERSION array=(a b c d e) echo $array:s/\/\&-\&/ ' 2.6-beta10-hzoli10.3 a-a b-b c-c d-d e-e $ Is this just another undocumented feature? Since there's no real need to escape the delimiter--just choose a different one--the backslash seems one of the best choices to denote "substitute whole string/ele- ments of array" to me. Sincere apologies for my GNUisms breaking hzoli10.2. Please forgive me. Thorsten BTW it is "substitution", isn't it? --- zsh-2.6-beta10-hzoli10.3/Src/subst.c.orig Wed Aug 16 00:46:45 1995 +++ zsh-2.6-beta10-hzoli10.3/Src/subst.c Wed Aug 16 01:23:57 1995 @@ -905,7 +905,7 @@ *str = aptr + 1; return n; } else { - zerr("bad subtitution", NULL, 0); + zerr("bad substitution", NULL, 0); return NULL; } else @@ -1465,7 +1467,7 @@ del = *ptr1++; for (ptr2 = ptr1; *ptr2 != del && *ptr2; ptr2++); if (!*ptr2) { - zerr("bad subtitution", NULL, 0); + zerr("bad substitution", NULL, 0); return; } *ptr2++ = '\0'; -- Thorsten Meinecke