From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1669 invoked by alias); 20 Nov 2010 08:22:03 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28423 Received: (qmail 1795 invoked from network); 20 Nov 2010 08:21:49 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: none (proxy.melb.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <101119100147.ZM4622@torch.brasslantern.com> Date: Fri, 19 Nov 2010 10:01:45 -0800 In-reply-to: <27165.1290012857@csr.com> Comments: In reply to Peter Stephenson "PATCH: bash-style substrings & subarrays" (Nov 17, 4:54pm) References: <27165.1290012857@csr.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org (Zsh hackers list) Subject: Re: PATCH: bash-style substrings & subarrays MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: quoted-printable On Nov 17, 4:54pm, Peter Stephenson wrote: } } This implements the ${NAME:OFFSET} and ${NAME:OFFSET:LENGTH} syntax. } This is basically for compatibility; we don't need the extra } functionality, but it's a syntax people are nowadays assuming they can } use. I'm wondering whether :OFFSET:LENGTH shouldn't always use KSH_ARRAYS semantics, or be a valid syntax only when KSH_ARRAYS is set? If it's for compatibility with people who are assuming it works, those people are also going to assume it has zero-offset, aren't they? There may be some error cases not yet caught: schaefer<508> foo=3D123456789 schaefer<509> unset y x schaefer<510> echo ${foo:$y:$x}=20 zsh: bad math expression: illegal character: =DD That =DD looks like uninitialized memory garbage. --=20