From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5701 invoked from network); 24 Sep 2020 17:08:04 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 24 Sep 2020 17:08:04 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1600967284; b=s9zYiKS4ACoeXuDiswT4r06M3pxTtoD/dLWXYM4Q9ZhthtXxT0X/1ef5BrYGjSUrc2HLkCtDBM m/d5ql4TuR/iElMUcI6ms1TRbID8TphrCGx1s9dJvZWltbV+nwAoO0+b2Ai7ybZl56AB6Aaj1G 3i3Pdlr/ppXwZdZgMPkzdaIS5XnRgxkA6H1yacTbdJjXOQaP8IUskYNsxpV3V9F+zP827CzJUt bALyMwuBw+Hm3u6adt+nIqC2VPftpE0wlEhf+BuNmmR/aQFyiHk9EZyEQl7bSvDUiZuWgxBF6w LUJ2Mr4se+xkBVnKpR9eypb5sIIhjjqmPhA1RtHaoZye/A==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-pf1-f176.google.com) smtp.remote-ip=209.85.210.176; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1600967284; bh=YFGHDzglqhWnIQbFdh7ziJpkRUSCE1BTx4hrgenk0EM=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Message-ID:From:Date:References:In-Reply-To:Subject:Cc:To: DKIM-Signature:DKIM-Signature; b=vtR5Kp0v+BtDP+PplaR9x+9jZkArxymyZU8p0oSlxZXhMpnbuSmyLeB1m2VBfz1qXweLZaDVij WkXngdz7E4vjVcWN6MfmJCbN7lpC30Af5AJZuZuYAtSnRrPs1UM93Wgq8olKmGwuCs4c4dFu4b TWdELEYnO/fhlWc2cbUrI2180zeAd22blmkrbcmxhf4ekc3x25PTq7PSHLRLAEbWNcyn5Z3AXC 47EM9GbpJLwV13UzI+MPXjuz951NJXb9vbO+gqy8SwRqYnImfHCbCe4cy2v01/9kH1feogrZKA TCGeU5RQs2/iVcOmk6lOuPR55AUoKp2AkRGQYmLCCCEcfw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Message-ID:From:Date:References: In-reply-to:Subject:cc:To:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=eY+X8fsWuZ7LLgqnUPPly48EFsSSzp8FoLBLr4T06vM=; b=D9rYvs5wV1BRrvmevei1Nz9Cmq mPW+d/0rFUdEokRbUcgwE4MIkofD6zBQYfBR7i1/lw37oSe3PQ1DLWbtpWcS8TUIvfDjd1Ono6Ydl 2++ct9J9TJTtN8tBiLtQ/sw15/uQgOxR6rOfBj7h3YYKhQYfzjBdPvPM+vxIu5dbLX8Bvl61LRWS4 FA+Gyr08ZFqBi2l4u9JDeynpXpVhvrM2otOkLJ7DG+FspleMzfwEgThbLkaeuxr0eKJCMqg3LhAxP jkqaKBr+eYNKjhOX4ja7/4NwmMGzgWYAAGeCQjRitD8sfcYSmSOXye6CoG6upGjbizaasDYd+BEVS bvHt+xqw==; Received: from authenticated user by zero.zsh.org with local id 1kLUiv-000P99-7a; Thu, 24 Sep 2020 17:08:01 +0000 Authentication-Results: zsh.org; iprev=pass (mail-pf1-f176.google.com) smtp.remote-ip=209.85.210.176; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-pf1-f176.google.com ([209.85.210.176]:34749) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kLUiQ-000Old-0A; Thu, 24 Sep 2020 17:07:31 +0000 Received: by mail-pf1-f176.google.com with SMTP id k13so2312209pfg.1 for ; Thu, 24 Sep 2020 10:07:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:subject:in-reply-to:references:date:from:message-id; bh=eY+X8fsWuZ7LLgqnUPPly48EFsSSzp8FoLBLr4T06vM=; b=a3B2XBdZAbY/gxmCBcM4v8H5Q+m2tLa6TUbZquFfO2UQVCPJAddPZXRLv7Xxd5ln6g PxNiC6leD34veQx6h7JUE0RKEdwq/OW5Wn4eAkaBUcDgDK6zWY0PTt/j18d4zq5OlfH/ PewacdUfP095z9ROE2Z1xB5ZgWUswrMfAXyHmMJIUpR6VdqyB+mAAbgU25/UQ8+YRlNC I8oJjsXUaHZlsBYSnr3rSzoTNJq45arGnF8w5O5jOrcQ+ezNK6RHMuha32mObRoP5NXa 8RcemUSwWoOci3VZgL63tvocyaGfm+3q1vUOJmlPsj1kqxFhEnMcgso6e2jRJ8pSXH2k roEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:subject:in-reply-to:references:date:from :message-id; bh=eY+X8fsWuZ7LLgqnUPPly48EFsSSzp8FoLBLr4T06vM=; b=d05mh3/T+C3/P/CKTh+yUMWucMaw4JEyAKEBc+90nwystvCdkhs1ADGqv9Wer/YQl2 tpTZNlN0gD/KEubxt99W4GpAm22o6L+0j7WiWHImE4iCrXSQCDwxBaayYNPDjEFtDC0o jh0ZXl24u3nKEFFNrMSv+2/AojRnRM1VgpPffD8Qh5iKohUaT/fZlcSot4Z7ixQU+eUB dyvMHjsxR3XO0FGFXmjEgM4eMBQ+DVdHGTHf5SuxxvgwTmf7feuwB+5buNHjxg6HfiPT D5hJT2+EDoNhWDzG3i7jNHsop769WRQqGnKYrWPA2Wb87bi6HLIXNnQq2tokcIOZlTJY h4MA== X-Gm-Message-State: AOAM532lrL+QT+J1m3dkh2tY30cLsK6EpeC8UnEhpuZvZT9swu0fPHKI TjsBVgsXSWnBSO2CbgJls6KDb0lBGy0= X-Google-Smtp-Source: ABdhPJyFLpydjeYfPKeZpgJm2oeXOPh1mxjVKIRtcbrZa1SkwsGRI7V0mDOt7xG452Elrwa8FDiKLQ== X-Received: by 2002:aa7:8f21:0:b029:142:2501:39e0 with SMTP id y1-20020aa78f210000b0290142250139e0mr58330pfr.47.1600967248231; Thu, 24 Sep 2020 10:07:28 -0700 (PDT) Received: from binki (mobile-166-137-178-054.mycingular.net. [166.137.178.54]) by smtp.googlemail.com with ESMTPSA id t15sm63200pjq.3.2020.09.24.10.07.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2020 10:07:27 -0700 (PDT) To: cc: Subject: Re: nested parameter expansion In-reply-to: Your message of Thu, 24 Sep 2020 09:15:25 +0100 (BST) <1356305032.19895.1600935325161@mail2.virginmedia.com> References: <20200924010311.7083@binki> <1356305032.19895.1600935325161@mail2.virginmedia.com> X-Mailer: MH-E 8.6+git; GNU Mailutils 3.10; GNU Emacs 26.3 Date: Thu, 24 Sep 2020 10:07:26 -0700 From: "jdh" Message-ID: <20200924100726.5496@binki> X-Seq: 26083 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: Thanks for the information Roman & Peter. Much appreciated. --------- Peter Stephenson wrote: > > > On 24 September 2020 at 09:03 jdh wrote: > > I can't get, what should be simple nested parameter to work. > > I think that $ndx needs to be expanded before the letter P before it 1st. > > > > Simple example: > > > > ndx=1 > > P1_ARRAY=("1" "2" "3") > > > > print ${P${ndx}_ARRAY} > > #results in: "zsh bad substitution > > I don't think there's a simple way to do it without an extra intermediate > variable: > > var="P${ndx}_ARRAY" > print ${(P)var} > > You could add some eval trickery, but I suspect it's not worth making it any > more complicated. > > pws >