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 10484 invoked from network); 25 Jan 2023 11:05:20 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 25 Jan 2023 11:05:20 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1674644720; b=bK7y08ul8Ykv/sL1Vl30IBVtU523t5L+hdG4I+6SwBL4dbsLc5vUW+kBya+s24l6+3mtnRI79C uWv1hzBr5Ob0kRUi2yL7bAcRsfPLwDqOFMvuO/sjaG3Qea9DHgJfxS1bGsJJCQR7Eud262kQbQ RGmcI8PcSFbBnasb32zKh3hxfKtb/PJTL9aZYsD53KKpAvdBploKYDOkg5YRehOz5zEdhPOLAw eOXHCUlLBXCJeqoAPpZRydYpnJo9uOb7Ln+a5Hg/vrQpfq4NKCartR2Ab0liuTS+8E0GcJqK1o ohiGiNSpboiYG7OXTydbU6r0M0N2qW3d5/t2+bWExiEdBA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f176.google.com) smtp.remote-ip=209.85.208.176; dkim=pass header.d=gmail.com header.s=20210112 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=1674644720; bh=+CZvHJJZm2+rsTNulMe1huvT+mwEwNO/fvQ7+x+lQAQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:MIME-Version: DKIM-Signature:DKIM-Signature; b=quZrKE707Njprji/JcJFl6epUaF5+4Vn0IeUJcDF+VNP3AhMwfnJpgoskcWlnr1YZQz34gCvZz D/Tk+Clt8gJ80eX2CsoY+YRWAFIxULqZO8ykUCsXdHxRv+m3LvezROjEpn77tUL1h6w3xfnVWm 6f5PnEoQsjkIhwfc1c+3Z2Zbp8qlCsFNA4+TvbHvKYA1A0EiJWmVcLtaLw4a4ilEyG273Bwm8x iWo5zmltbWaASCbPnF6CumC5VNajt9njycw16ZRtZrYDQBNPaOW4ZeEsL30j2i+5CtKBP+F0qe MUtpoNiJ5FsNaUdakbB2HmOJ5mdKhgaCDcVP+WcHpIcPDA==; 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:MIME-Version:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=yn6fOh+w7QNIDDylSqPLqPNX84lRKceIylG4avtELOU=; b=L2hSRiRe5/ygQr3xiDD80o1UbM 6nm6tKnH5fzAOmaM5Cur7aNI/nhaf4dmKS1KZ3rJh+HhSuvVjGYkYz0NfjccOe17NPZ4symtlGfo4 S20tVJdNBsfLEBDvoNf+34JSK+WW3JlF6d33R/dwahfY4l/bJBooCR1jCSnQk0u1CrAH31ctQBn/k zkpf4YeVSys/JtJLg6w8teF+E4ssh04IBkFD427x49/6TwF2OCrSXK5lITs8uJHKsDLENuGcubMFF KP5mtgn49J59aBQpHzb9Jh//sn70Gwy/uORjc4yc+fxwW4DXj/gnzrZHn10ymt9CnUHxHg49hyMUz FKoMkWKw==; Received: by zero.zsh.org with local id 1pKdag-0009hq-TI; Wed, 25 Jan 2023 11:05:18 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f176.google.com) smtp.remote-ip=209.85.208.176; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lj1-f176.google.com ([209.85.208.176]:44761) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pKda3-00091b-F0; Wed, 25 Jan 2023 11:04:40 +0000 Received: by mail-lj1-f176.google.com with SMTP id o12so1006093ljp.11 for ; Wed, 25 Jan 2023 03:04:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=yn6fOh+w7QNIDDylSqPLqPNX84lRKceIylG4avtELOU=; b=GaLtiW0CZrgHRGluKQdCWQ189wXpOIGreR/cPkeAfxzVP19rfDAQVTudbI5dKlkZhp txeslLRXX69pX0UmCHhZpHmfYx0vHhrR4H6cnfonvTmKU1BEPE/BCe5BBc36G6VlyVsf wkQ8tqjw23ggWkijF86rROXwNqMSB4bAZhPwGpXGrQ959y+WqamRyv0k3mx22oKBI5Np jLOwa0l/kKl0aU31bXEVlWwe/S0KyF153zJ33eZzpxWqisi9ZuA56ydtdZECoowSeMFK M1f9BDo+KomVdDbxfBWFS3CW3J5HivdzAmztR29FdJyvHovL1SPmnRX1vSpdquI3lC3Z mvqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=yn6fOh+w7QNIDDylSqPLqPNX84lRKceIylG4avtELOU=; b=2eldVW53CAAfmgWwfpcYO88gbDgjEL3dD4GyA3kF2QRUlzYdYE6PD5I670bjN0/OhB eKGZzbq+tOV/TMD8GF/wHFDGueRBLM0rWYvFM0dqOBUnRIs85rQtpokL6NsYE0q5qR2e 5mMTcAZH32TUr2vfrGR4XO4tQQiMmZledbblH8e2w2RCFLUabBOQEPzp5yPNAdmZB++0 uEIPqcg0xX8oKFmduGEkrDiiEGCHY4lb05tnJu0ETj8es6H2dX223SXPeVexCH/W2PlX Dhp+vjTGTBFtpgpPt2J14OSmI/CNg5UUDysl6MGNCI/5tmJKXjddn99kYYYVlzPaoXQ1 Kfyw== X-Gm-Message-State: AFqh2kqzyv55EjmwP+XlQqVaJrfFSOoofrmb1i2bnHARhok32+5f5SKv SPaNcSY2W4h/si+J03u4gMwOdC3l9vAUiwjKYj1SDgdFl0A= X-Google-Smtp-Source: AMrXdXvzajwXY9g1YhHn3GH1B/maLGX5ROgSHcOB4d/8ToCIa3x/sh8zESXyumQ4soa2MKxkskU8taztFrMUKgJCafI= X-Received: by 2002:a2e:9947:0:b0:289:87a:ac8 with SMTP id r7-20020a2e9947000000b00289087a0ac8mr1344136ljj.266.1674644678762; Wed, 25 Jan 2023 03:04:38 -0800 (PST) MIME-Version: 1.0 From: Sebastian Gniazdowski Date: Wed, 25 Jan 2023 11:04:12 +0000 Message-ID: Subject: Why a '-quoted string isn't respected by // subst, while \-quoted is? To: Zsh Users Content-Type: multipart/alternative; boundary="00000000000033e57205f3149958" X-Seq: 28779 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: --00000000000033e57205f3149958 Content-Type: text/plain; charset="UTF-8" Hi, I'm storing a pattern in a var: E="0='\${\${\\(M\\)\${0::=\${\\(%\\):-%x}}:\\#/\\*}:-\$PWD/\$0}'" to then match it against: Q='0=${${(M)${0::=${(%):-%x}}:#/*}:-$PWD/$0}' with // substitution: printf %s\\n $E $Q ${Q//$~E/q} The result is no match. However, if I instead quote the string with \: E='0=${${\(M\)${0::=${\(%\):-%x}}:\#/*}:-$PWD/$0}' (only ),(,#,* are quoted), then it matches. Why? It would be more comfortable to simply quote with ' the whole string... -- Best regards, Sebastian Gniazdowski --00000000000033e57205f3149958 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,
I'm storing a pattern in a var:

E=3D= "0=3D'\${\${\\(M\\)\${0::=3D\${\\(%\\):-%x}}:\\#/\\*}:-\$PWD/\$0}&= #39;"

to then match it against:

Q=3D'= ;0=3D${${(M)${0::=3D${(%):-%x}}:#/*}:-$PWD/$0}'

with // subs= titution:

printf %s\\n $E $Q ${Q//$~E/q}

The result is no match. However, if I instead quote the str= ing with \:

E=3D'0=3D${${\(M\)${0::= =3D${\(%\):-%x}}:\#/*}:-$PWD/$0}' =C2=A0

(only ),(,#,* are quoted), then it matches. Why? It would be more comf= ortable to simply quote with ' the whole string...

--
Best regards,
Sebastia= n Gniazdowski

--00000000000033e57205f3149958--