From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 3CF8C242B9 for ; Sun, 5 May 2024 15:14:49 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1714914889; b=ZxNeSrassJ+HrHuAh3pLqWvOSq5rf+ww/uBBDFvVuv+vrYQKyYteb2J+S0LF4zEzENj25n1nz1 VIjzp7jWyMA8LdEMSgYyZe4KG/eQQFnmQNOOZGAtPsSlod2bzVcRlU+TBWCkwR1LKLxicJ977F 2ZqcyGAWB5+3SpYZ4PCdiDs48LRsaCTOE2OKkO5tTLICcmEeeA+IU/4q+Gi7dgoYWrg5pxGQHw 27zfi9Wc4jpkqnvjfI5MEXfJ3aWbLiLJ3oa/jzq9UI9KdYH+uYAEZItbW4Y2a7If9Oywog8K4e ce81q05Iohe0AZOsoSPla2GCnPcTDTl/DnFqvoJTgpTNMA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta01.eastlink.ca) smtp.remote-ip=24.224.136.30; dmarc=none header.from=eastlink.ca; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1714914889; bh=vxhHBCuum5bd3Z1MKWeB5RC1ZsuycgqwCCX52QKmjzk=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Content-Type:DKIM-Signature; b=m/E1Vj4S6w6UnN0HUkeGUqNPS0LswAT4/lITtPdw1RvtmfGd7MYeCxxOt0etw34wROcSaVnqnZ Z0AGVTPzFFl2MXoNqXyka91sa3gRCJxMdDbf0rhDsjD1KPD6tx2UsUJ6RuM23v8+gNWkXaNaqP zjisGsD6YWGfY5ShG9M3M8ntmllezuxN0caUYD9DzF/jbCOnFrkGNDnCDPVTY1EOo/ttOoHgtE K2Z50WRTDGYCU3YrRMfnW+yU3ZbxvAaK8JM+I6QJiLf0fqFJOshxSDWgrhiePi8v+sSE2WZUn/ 98KhGmbVgLYlIsMLDqcJytlfNDbA3wrAyEqBFAomnFdETg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-reply-to:From:References:To: Subject:MIME-version:Date:Message-id:Content-type:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=k++ezmphsUpvrqkLqUYT9csz+LgU3lMPNmOVbPCDEC4=; b=JVg/SVv4XU90B2Z3W7TbF4o5Aa Q5WH8Y3x3w5JS2bIDz6Lc2ULpPUHy27nMj59fIavSlc3xnu77EV8vyx8OsNtAzWN6MGlZJOgIlDoB CvXc0777yLMu23Qu1xOFogRznipDYLkUId41so4mwJc8uoKgegWWw4ouIGciLWv1Q6Pp34CTxlSEb nEyhmtMquQHBfeBfzhzYFM7dlPAGz5sV8nZbQxFSPDQG63FumpvPjVQJpV4dVSknEMBd4NZq8Sa3c zo1Vfo7RDU0J198F/WrlJ2uGA+1qv2PckCs7vz9Ni4olT08nHNZxVEXLOgki6zY9rYJTpZZ0DSmvg nAVszBXg==; Received: by zero.zsh.org with local id 1s3bhY-000Ftu-K6; Sun, 05 May 2024 13:14:48 +0000 Authentication-Results: zsh.org; iprev=pass (mta01.eastlink.ca) smtp.remote-ip=24.224.136.30; dmarc=none header.from=eastlink.ca; arc=none Received: from mta01.eastlink.ca ([24.224.136.30]:49253) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1s3bge-000F9m-1g; Sun, 05 May 2024 13:13:53 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta01.eastlink.ca ([24.224.136.30]) with ESMTPS id <0SD00OGZTKQUME80@mta01.eastlink.ca> for zsh-users@zsh.org; Sun, 05 May 2024 10:13:50 -0300 (ADT) Received: from [192.168.0.11] (host-24-207-19-13.public.eastlink.ca [24.207.19.13]) by csp01.eastlink.ca ([71.7.199.166]) with ESMTPSA id 3bgbsmfnG98ni3bgcsoWB4 (version=TLSv1_2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256); Sun, 05 May 2024 10:13:50 -0300 X-Authority-Analysis: v=2.4 cv=C75KyhP+ c=1 sm=1 tr=0 ts=6637860e a=e7T7DzMKK1R988ZCg0wLyw==:117 a=e7T7DzMKK1R988ZCg0wLyw==:17 a=r77TgQKjGQsHNAKrUKIA:9 a=vfQ4NOsI0JsAH3EaVZIA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=pGLkceISAAAA:8 a=94yVnaLZxJDPJnvg2J0A:9 a=zm95Jh07PasuKAYl:21 a=_W_S_7VecoQA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddvgedgieehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecugfetuffvnffkpffmpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurheptgfkffggfgfuvfhfhfgjsegrtderredtvdejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpefhteethfevgeeuvdelgefgvdevudefueduffdvgfelvddvgfdtieegueeuleeifeenucfkphepvdegrddvtdejrdduledrudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrdduledrudefpdhhvghloheplgduledvrdduieekrddtrdduudgnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Content-type: multipart/alternative; boundary="------------tpKYVH29tlaBkmyACKxXlRtO" Message-id: Date: Sun, 5 May 2024 06:13:49 -0700 MIME-version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: nesting issue To: zsh-users@zsh.org References: Content-language: en-US From: Ray Andrews In-reply-to: X-Seq: 29892 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: This is a multi-part message in MIME format. --------------tpKYVH29tlaBkmyACKxXlRtO Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2024-05-04 20:20, Bart Schaefer wrote: > They give "bad substitution" because you can't have a space before the > closing "}" / after the closing ")" in the parameter expansion. > > local sorted=( "${(f)$(print -l "${(n)in[@]}")}" ) > Nuts, I wouldn't have even considered that. Even tho it is accepted here?:     sorted=( "${(f)sorted}" ) I've tended to space things out for legibility, ok, good to know that sometimes the parser doesn't like it.  It really is nit picking but 'that' space seems to be 'outboard' of the actual text substitution, IOW it seems as if the swapping of 'sorted' for '$(print -l "${(n)in[@]}")' is accepted verbatim an *then* the issue with the space comes up after the fact.  Not that it's worth worrying about.  I consider the parser to be a miracle worker as it is. One thing tho, since nested quotes end up un-quoting the inner quotation (or is this an exception?), I'm thinking that:  local sorted=( "${(f)$(print -l ${(n)in[@]})}" ) ... one set of quotes -- should be fine.  And it seems fine.  Or is this one of those things where spaces in filenames is going to gotcha me? --------------tpKYVH29tlaBkmyACKxXlRtO Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

On 2024-05-04 20:20, Bart Schaefer wrote:
They give "bad substitution" because you can't have a space before the
closing "}" / after the closing ")" in the parameter expansion.

local sorted=( "${(f)$(print -l "${(n)in[@]}")}" )

Nuts, I wouldn't have even considered that.  

Even tho it is accepted here?:

    sorted=( "${(f)sorted}" )

I've tended to space things out for legibility, ok, good to know that sometimes the parser doesn't like it.  It really is nit picking but 'that' space seems to be 'outboard' of the actual text substitution, IOW it seems as if the swapping of 'sorted' for '$(print -l "${(n)in[@]}")'
is accepted verbatim an *then* the issue with the space comes up after the fact.  Not that it's worth worrying about.  I consider the parser to be a miracle worker as it is. 

One thing tho, since nested quotes end up un-quoting the inner quotation (or is this an exception?), I'm thinking that:

 local sorted=( "${(f)$(print -l ${(n)in[@]})}" )

... one set of quotes -- should be fine.  And it seems fine.  Or is this one of those things where spaces in filenames is going to gotcha me?



--------------tpKYVH29tlaBkmyACKxXlRtO--