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,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21648 invoked from network); 13 Sep 2023 11:30:27 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 13 Sep 2023 11:30:27 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1694604627; b=A/iv4LJdsWDim0+InhDfR+BtH6Ir8OrMP6znJw85M9MS+cflmz6kneZMbFf8dKypbFw2BxIK/c zDyjHXjyww46dhSGq4yXM545nOzkO+ZCuk5liHr6UG6BRbkqNuGPazcuKAveLhDYQW4AGoTb6I WQMW+NRRt2hv1sjnXOy1Lre/wIx29Hz9VOSyCfq7uCR+GrBLx0YkvLqFqe95IsrHAr6KqrbcQC WoSl/6GAt+d2tAC55/80KGjUi+3hn/JzaK1cOJBHyQrlZqbJYiq+GY5GYhzHIyBCdsRyo8UtKI rkP/n6SpIeORyvruII9QGv33AtmKn3VXH7onbU7IgASz8g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-pg1-f170.google.com) smtp.remote-ip=209.85.215.170; dkim=pass header.d=gmail.com header.s=20221208 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-20210803; t=1694604627; bh=X05GjGIoBGmIF5YvRqZErfDdRO004oOOuIC92oRdkpI=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:Reply-To: In-Reply-To:References:MIME-Version:DKIM-Signature:DKIM-Signature; b=XpuzMcryJfKbFfKArwLZhfI3TOde+fdZiQV2nugEylEsX/hFM7OCcHh3Iivf/J1Ss/RfusPnDj lpR1TcmK8mISLCgBIVfmeio72GAg1GPLXWyppxK4dAvie0I323XndpDvQJvLepHhJpIOP2gVlO OPEIFEKA/DF1k7ww8cCz6g8MBZfaESSbkoALT6B5iVHtNlYS+7I9ptQ+zbGlX+qrjyxvlik9Hs 3dcWTYDMV0NqI+Qb5HSuIKuMa99RYwwC1PHOxV8iWaBtD5DbyEiRKQXbEBDZCBH4N8HOz02HHW LxY8NzFOeYWsBVkLkRGh2DWYgv4NZOGWosm0uJj5zC8HiQ==; 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:Content-Type:To:Subject:Message-ID: Date:From:Reply-To:In-Reply-To:References:MIME-Version:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=fw0rQ/zaNqgt96H9r80gG/0ubny97bhusJMs3IijasE=; b=ntEsDeDqr16jz9nNPZcA6FmtKY Vyg4LEjFe6UnXGKfamQVLKRjLmlVrh+d6LMaNwsmqIiwLN920Q04YKrwanWQZfXXKDinuCtS7phG6 jpK0Kuom/AeoN/agAu3hEzCziEvKraMzNtcdl59OmYGyx9rYgo1q+ctwItDGHAobhbxjhhwcgYt7h p1sAGnGyXSkvMDm3aQvO0We7DNSr26MWaf83zDS6ZovATzaIkeAlGYjc2K486UdIaBiydyk3Wk2IX rQYdXSkCHHh+p2XD1l5r3HxltamUhGIGtTZABGmOeh6Fic4FbBMuOWRBNYUlVo3C6xXTq/XhO+xcs TvIUbSWQ==; Received: by zero.zsh.org with local id 1qgO4g-000FD9-Fn; Wed, 13 Sep 2023 11:30:26 +0000 Authentication-Results: zsh.org; iprev=pass (mail-pg1-f170.google.com) smtp.remote-ip=209.85.215.170; dkim=pass header.d=gmail.com header.s=20221208 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-pg1-f170.google.com ([209.85.215.170]:47224) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qgO3N-000ETO-Su; Wed, 13 Sep 2023 11:29:11 +0000 Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-53482b44007so4723727a12.2 for ; Wed, 13 Sep 2023 04:29:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694604544; x=1695209344; darn=zsh.org; h=to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=fw0rQ/zaNqgt96H9r80gG/0ubny97bhusJMs3IijasE=; b=lwuXeWPLEXLyMgxJ3xiFq8SGNtbPcEQHPO89Wq+Ya9UhQ6A1rxqIx8HMkikORoY1HO Du3LNWUHIEUzZH1Ejgd7cUBK1qvkR9E22yppTvrm/V6ObYivlgnLXziLDvF0Qvm3ePKD 9B0i5HHzgjHHDiaHp6A3CL3jY4bfYkqoBIEUEHlL+nvFVnD2sbDRiJDG68dVlYzXyYuI RvA1csYab54/bkNZ48XSICavo504m7C8PQynsRIZH3pkOxdXHQgMvoxO1PhXY3C7vTAn CT+WlzzhStSj0JdLxSW9UiSkX22XyZasxL57gjm/+AzLkVkcvi+9On4uyERJmsts4voj K/aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694604544; x=1695209344; h=to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fw0rQ/zaNqgt96H9r80gG/0ubny97bhusJMs3IijasE=; b=WUd0B8cAGN2FDaw41371ZxHOdI6Mhers0qPgzdz9Z7HwwYkQI68U1uDr/6rl0AWBq7 +V+fDIWMU45F3Ukn/D8MwGQ/S3wM6+XrIN0yGgcRQEDxH9HIyUv2WZ4kRHV8sWNEiokB 1wbiTha0q3tNEZ/qe4jznXffWJgmZd5K4KpXynQiZU+feJJFQNyN003th9Zk6Lm0EKaf 9oTZPFGcGomo+w1f/orDX1J+Qiikwt+GZ7Fl4ofBLvnn+plLhy1+vUt6R+NnMgfZ4laL ISr38aM1DAqxa8FvUYamabatDNwUuh0xeeA7pXq4Kd1lm5DHEd0ZJTcECSBP2lOX+s8V BlwA== X-Gm-Message-State: AOJu0YzS2QRX3ozJf/Mct+c1/vUTLoYG48dG7klDZOf+5857kIyyktEG Ie8X/C9ohxLiDkWZ4RTo+3uihZ6uXS+vUVZuzrSjX7D+o0U= X-Google-Smtp-Source: AGHT+IHXiMUazTx6eyLZ9DcTRr9qK5Ng6m+2tQl4xHqJM90HCADI1E8JRcioRBdFnKigp8W3x3rPjm7wZ3RWLCe+2UI= X-Received: by 2002:a17:90b:1d03:b0:268:352c:9d13 with SMTP id on3-20020a17090b1d0300b00268352c9d13mr1839149pjb.0.1694604544153; Wed, 13 Sep 2023 04:29:04 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Reply-To: linuxtechguy@gmail.com From: Jim Date: Wed, 13 Sep 2023 06:28:38 -0500 Message-ID: Subject: Re: quoting question To: Bart Schaefer , zsh Content-Type: multipart/alternative; boundary="000000000000e39c1e06053bddc4" X-Seq: 29243 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: --000000000000e39c1e06053bddc4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Sep 12, 2023 at 3:07=E2=80=AFPM Bart Schaefer wrote: > On Tue, Sep 12, 2023 at 11:46=E2=80=AFAM Jim w= rote: > > > > Zsh quoting at times makes me wonder. Do quoting? Don't do quoting? > > The following case has me scratching my head. Can someone explain what > is > > going on? > > This doesn't directly have to do with quoting, rather it has to do > with ${param} expansion and brace expansion. The short answer is you > should never have unquoted { } inside the ${...}, because the first } > encountered is usually going to be interpreted as a match to the ${ > and not to any other { in the string. Where double-quoting gets > involved is because inside a double-quoted string, none of the pairs > of { } have been tokenized, so the lexer can't distinguish which of > the two }} is the actual end of the expansion. > > For the fifth statement: print -- "Date and Time: ${(%):-%D{%Y-%m-%d %H:%M:%S %Z}} Test" The following works: print -- "Date and Time: ${(%):-"%D{%Y-%m-%d %H:%M:%S %Z}"} Test" Is this the correct interpretation of your statement, or did I somehow put a bandaid on it. I appreciate your input. Thanks and best regards, Jim --000000000000e39c1e06053bddc4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Tue, Sep 12, 2023 at 3:07=E2=80=AF= PM Bart Schaefer <schaefer@= brasslantern.com> wrote:
On Tue, Sep 12, 2023 at 11:46=E2=80=AFAM Jim <linux.tech.guy@gmail.co= m> wrote:
>
> Zsh quoting at times makes me wonder. Do quoting? Don't do quoting= ?
> The following case has me scratching my head.=C2=A0 Can someone explai= n what is
> going on?

This doesn't directly have to do with quoting, rather it has to do
with ${param} expansion and brace expansion.=C2=A0 The short answer is you<= br> should never have unquoted { } inside the ${...}, because the first }
encountered is usually going to be interpreted as a match to the ${
and not to any other { in the string.=C2=A0 Where double-quoting gets
involved is because inside a double-quoted string, none of the pairs
of { } have been tokenized, so the lexer can't distinguish which of
the two }} is the actual end of the expansion.


For the fifth statement:
=C2=A0print -- "Date and Time: =C2=A0${(%):-%D{%Y-%m-%d %H= :%M:%S %Z}} Test"

The following works:
<= div>
print -- "Date and Time: =C2=A0${(%):-"%D{%Y-%= m-%d %H:%M:%S %Z}"} Test"

Is this the co= rrect interpretation of your statement, or did I somehow put
a ba= ndaid on it.

I appreciate your input.
Thanks and best regards,

Jim
--000000000000e39c1e06053bddc4--