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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 25450 invoked from network); 21 Jul 2021 20:42:45 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 21 Jul 2021 20:42:45 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1626900165; b=bNSVgoywqJqWqGs+ia0tHgdLIpMAxtocE/YGJ8oCP+WQGmpz6a9mD9To7D/V99zPpy86CsxHn6 37Z15ZPswDdIsjx4xKxjvU1AvtEbCmVc/mbeI+MEkLgIxzp+0RtoEAZLWW67nFK60PVgFN8jje TdDWbIjWeh9bOnC2/K2zaejgWzqDIwjcE9xRYGPbEJbDg9Qaa60X4BuUXaWrojZdX5PzSNR57E 91PntUqazXk4rre3m2z3/osmKQ7gTa5wsMbukVNM4eZsn7VBq8ddVqEtrCqKrF0NB70ghLnMRX UEK2hR/ZbwaFM80ZYh1nxJ1P2Vc9+nO2likbFMCsMZdnwA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (smtp.vivaldi.net) smtp.remote-ip=31.209.137.12; dkim=pass header.d=vivaldi.net header.s=default header.a=rsa-sha256; dkim=pass header.d=vivaldi.net header.s=default header.a=rsa-sha256; dmarc=pass header.from=vivaldi.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1626900165; bh=4tjYyVP7DtomHxCSKVRmSor9+dybBXXYBtrxZ75hUw0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Message-ID:Date:Subject:Cc:To: DKIM-Signature:From:DKIM-Signature:DKIM-Signature; b=pfJwPzBHHcufrCH3mh3d2J2zU94JrKSYEX1sfC/kgFcUIm9Jugs+vZYNkUCLuexfio2H9pj4jC JBACjUb8QA9u9uGI1phKgqOfPjLDid9Pu94zNFeHkU2tSyzJBc99Pf99qvU3lPfCX/frRJy0ny +bNRO/ANmkhlXMIWanxhgZpUFg37q1Zm0J3rGC+XDXTKIKNRPyxuB1MvpDcQPBkFh6y1bejDP4 BtE61l8qc8qtxH0Flz0PocpwX1sf73LkPsln/+5ge5vhPjKJXkTNP9I6rkxle0acZnXtsV74Bi YO4/SP6lQpZUxVKDgPH8jXGcOw7lt77dh1IlEA+/BTyCZg==; 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:Content-Transfer-Encoding:Message-Id: Date:Subject:Cc:To:From:Reply-To:MIME-Version:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=wsJaD4ZMJ2Y6BhUY4/68GnurhLQs80PClJ9GbPNFpco=; b=dHwdh1FuLTEx/ORZPabrY4ko4y emn8V83C5DGRbYTS/w+WvkNwWcYIq2QxGJlFN8AWiwuFesXyLjG81Wx9EQi0maC1KiR2J5NSKYKPm +o/f4/7a+r9UcUMEkehHmumbbGnlvKjdfHRegdK3QovSs5VhhNjRIX4fu0gHel3WR4m31dMO6jlu+ i1lqp/vmkNNiRrpa6uTDzmyULtUX/jIuQnKrihgDn9P0u7cymtfDwW+3QSqDQ4B5OX/9YONX37/9E f8ZaULzB8FzC5zqHI5c6TLey8lv0r6vsCKsYoUlke0M4uszUcDSbMMyq6oy9YywcD0wkmOWeO+q6e +Xrb52+Q==; Received: from authenticated user by zero.zsh.org with local id 1m6J3F-0008Gl-4i; Wed, 21 Jul 2021 20:42:45 +0000 Authentication-Results: zsh.org; iprev=pass (smtp.vivaldi.net) smtp.remote-ip=31.209.137.12; dkim=pass header.d=vivaldi.net header.s=default header.a=rsa-sha256; dkim=pass header.d=vivaldi.net header.s=default header.a=rsa-sha256; dmarc=pass header.from=vivaldi.net; arc=none Received: from smtp.vivaldi.net ([31.209.137.12]:46868) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1m6J1p-0007ue-Ru; Wed, 21 Jul 2021 20:41:18 +0000 Received: from localhost (localhost [127.0.0.1]) by smtp.vivaldi.net (Postfix) with ESMTP id 3AFADBD01C; Wed, 21 Jul 2021 20:41:17 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.vivaldi.net 3AFADBD01C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivaldi.net; s=default; t=1626900077; bh=wsJaD4ZMJ2Y6BhUY4/68GnurhLQs80PClJ9GbPNFpco=; h=From:To:Cc:Subject:Date:From; b=Ljbxuc6rGUnzell7M6wvYokXaXaKGQIKuoEGisHD+LUbt7QjOKGQE+x0t2/diFfHW k08C48q+ne9MOno+PcmK54quqTMEpDN4ztyoU8BrHX5baTMNLdkNSrjBhBKzczJjQW Cgh51sCNd3g03ZVx6qMwOFflg9Og1P275Kuop5NFn46IsHQUCp6ZEvkUFMkHGN6IoB aXsecsrt59lpFgHwN3jgVCrIcVZ9bk594jm7Qe20005l4gaP88MQherD5GQU9xLSVZ oCQA2nJNmImREFgl166x8U+1rdg70A3lD2TPhH5cmgb8RHzFwlAYsqqD+niddIzybj Hp/6sRWCKEurQ== X-Virus-Scanned: Debian amavisd-new at smtp.vivaldi.net Received: from smtp.vivaldi.net ([127.0.0.1]) by localhost (mxo.viv.dc01 [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3Dd2_68XItlL; Wed, 21 Jul 2021 20:41:15 +0000 (UTC) From: gammafn DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.vivaldi.net A30E6BD031 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivaldi.net; s=default; t=1626900075; bh=wsJaD4ZMJ2Y6BhUY4/68GnurhLQs80PClJ9GbPNFpco=; h=From:To:Cc:Subject:Date:From; b=Xjv2rqFvAyD1JbvMgtnMxwOHWHtY6rAhgGDanPgcMmMRY2J1rkTg84jyFGos0Cx0f nrBgdBfhsUhPSqbX9UdX/dtbMqhHAS/n/9+8rNISjK+VysdcljqAV8c5a/UjojOzin VhqSJ/ANIsNwSm48Wie2ZHj9NU19QDNlk5Dr2bn9+/qt74O2REbops0m5mc367//sz FMLzRbFru7moHIBpepeHH31H4lA0j6WUz1koLq6MHbgLhRzDPOTE4RA2PZCofG4hp0 Te8f/1GPc2TkrJ+d+wcxtalDSCMT6+unzAtPh9cw8kQuLZ4zoPctsI95jnR8SOS9+r 4jQTZY4S8txlA== To: zsh-workers@zsh.org Cc: gammafn Subject: [PATCH] Doc/Zsh/expn: Elaborate how 'word' is expanded in PEs Date: Wed, 21 Jul 2021 15:40:34 -0500 Message-Id: <20210721204034.1107354-1-GammaFunction@vivaldi.net> Content-Transfer-Encoding: 8bit X-Validation-by: kb@spambri.de X-Seq: 49183 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: --- After some discussion on what does and does not happen in PEs on irc, I added some more information on how the alternate value `word' is expanded. Additionally, I saw that `word' has documentation both before and after the alternate value forms, so I unified the examples. Should we also mention how quoting applies to `pattern', or is that obvious enough? Doc/Zsh/expn.yo | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo index c218ded05..594ef751f 100644 --- a/Doc/Zsh/expn.yo +++ b/Doc/Zsh/expn.yo @@ -616,6 +616,14 @@ substitution on the expansion of parameter tt($i). In the following descriptions, `var(word)' refers to a single word substituted on the command line, not necessarily a space delimited word. +Therefore var(word) in unquoted parameter expansions can be subject +to all expansions, but are not subject to splitting unless +the parameter expansion is subject to tt(SH_WORD_SPLIT) option +the tt(=) flag, or the tt(s:)var(string)tt(:) flag. + +Standard shell quoting in the var(word) value can be used to selectively override +the splitting done by the tt(SH_WORD_SPLIT) option and the tt(=) flag, +but not splitting by the tt(s:)var(string)tt(:) flag. startitem() item(tt(${)var(name)tt(}))( @@ -669,11 +677,6 @@ the prompt. If var(word) is omitted, then a standard message is printed. ) enditem() -In any of the above expressions that test a variable and substitute an -alternate var(word), note that you can use standard shell quoting in the -var(word) value to selectively override the splitting done by the -tt(SH_WORD_SPLIT) option and the tt(=) flag, but not splitting by the -tt(s:)var(string)tt(:) flag. In the following expressions, when var(name) is an array and the substitution is not quoted, or if the `tt((@))' flag or the -- 2.32.0