From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3881 invoked by alias); 1 Jul 2012 18:15:39 -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: 30554 Received: (qmail 16372 invoked from network); 1 Jul 2012 18:15:35 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: neutral (ns1.primenet.com.au: 74.125.82.171 is neither permitted nor denied by SPF record at ntlworld.com) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-proxyuser-ip:date:from:to:subject:message-id:in-reply-to :references:x-mailer:mime-version:content-type :content-transfer-encoding:x-gm-message-state; bh=m48ryc5RmnQuImeGb5rwJBxhv+dqZQmfLpsVafqFpTc=; b=hhgf9IMMqy5THeNc/kcvvTVzyZziyU1hfRKwhuoExRtYvkpX4U0S+heErzk2stTg2a i8cQUa5pnnkCowbsa057Ac42L808RRlP+GnzkR7tImQ8eKDC9ttmIfk0ku5gntOAersy sFoC/XX5W0Arep8nFs8ysMcGqtW7597m9zJ1Fj5bT3eWds+s4PmewYL+V4Fexc2mLQr+ o90T2NukOVXytJkCPWZUrhIwLt5i+wQs9vVPDNacCrWtxX1LwkpKbaNHJb4hAMDZdjAH RvaOGkqdlok7KHe7L8D5K+cpx3TOlUUblPbogCZZcmSG3ADNCtaVDoAa3qh1ROhFhdgG /HcQ== X-ProxyUser-IP: 86.6.29.42 Date: Sun, 1 Jul 2012 19:15:26 +0100 From: Peter Stephenson To: Subject: Re: PATCH Re: let unset array element remove compatible with bash Message-ID: <20120701191526.50e2cf7d@pws-pc.ntlworld.com> In-Reply-To: <120701095354.ZM28458@torch.brasslantern.com> References: <120221210106.ZM13374@torch.brasslantern.com> <20120222095248.1ea8140b@pwslap01u.europe.root.pri> <120222092827.ZM24425@torch.brasslantern.com> <20120222201939.53899980@pws-pc.ntlworld.com> <120701095354.ZM28458@torch.brasslantern.com> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQkGLmNaaRCQuwp0QbEvWpPbe9dYJpD8FcO8/4gQhNPX4JBk6B5Fkmm5s5BJXjr9H0/jPPg3 On Sun, 01 Jul 2012 09:53:54 -0700 Bart Schaefer wrote: > So the patch below makes > > noglob unset foo[x] > > work properly. If x is an existing index (or valid slice), it is cut > from the array as if by foo[x]=(). Do you mean that? That's not how bash works, it doesn't cut the element, just remove the value at that index (ignore the offset-zero vs. offset-one difference, of course): [pws@pws-pc tmp]$ foo=(one two three) [pws@pws-pc tmp]$ echo ${foo[*]} one two three [pws@pws-pc tmp]$ echo ${foo[0]} one [pws@pws-pc tmp]$ echo ${foo[2]} three [pws@pws-pc tmp]$ unset 'foo[1]' [pws@pws-pc tmp]$ echo ${foo[1]} [pws@pws-pc tmp]$ echo ${foo[2]} three -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/