From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 18 02:03:23 2021 Received: (at submit) by debbugs.gnu.org; 18 Jan 2021 07:03:23 +0000 Received: from localhost ([127.0.0.1]:46169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l1OZM-0004pe-Hy for submit@debbugs.gnu.org; Mon, 18 Jan 2021 02:03:23 -0500 Received: from lists.gnu.org ([209.51.188.17]:52466) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l1Gxz-0001X0-5P for submit@debbugs.gnu.org; Sun, 17 Jan 2021 17:56:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41720) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1Gxy-0003Q0-SX for bug-sed@gnu.org; Sun, 17 Jan 2021 17:56:14 -0500 Received: from mout.gmx.net ([212.227.17.20]:59833) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1Gxw-0001nh-RR for bug-sed@gnu.org; Sun, 17 Jan 2021 17:56:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1610924169; bh=2oEDlcfRst1f6YCdmdX/wdS1m5m5ahDv+bSGKDhoxFk=; h=X-UI-Sender-Class:From:To:Subject:Date; b=CS0Pv2KGDdi7zzZsewjJiOYXZmVO/ZRMdD8lauLU4huGV9KAMfAp/ox4IuSj1xFG+ CDeyrNGsrn0fW5bncTQ824dcQLO9s/oO8EG9kzv0fp2aT8hefYZgm/KHUFqq6qRinU AGfwGqg3pagTl6YbN/WJ8+3BopzJirM1xnNmtznk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [82.52.195.156] ([82.52.195.156]) by web-mail.gmx.net (3c-app-mailcom-bs10.server.lan [172.19.170.178]) (via HTTP); Sun, 17 Jan 2021 23:56:08 +0100 MIME-Version: 1.0 Message-ID: From: Nora Platiel To: bug-sed@gnu.org Subject: documentation is incorrect about the T command Content-Type: text/plain; charset=UTF-8 Date: Sun, 17 Jan 2021 23:56:08 +0100 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:bUJzOZJ/KgiwT+lmz1PebQyRCGYT1rkNXdIsjcHx/xL0xFVqwMDIS/gFfGqBsqhN15iR0 MmlBZ+tfChd3ABLuN/JvNn5DH/aCOX+F4iZoJa8HfHrjSx1/3Ao5xOkgkYBuvQuL5qbUCjcIsf5s n7bOT/olcdbxh8xGvLbMykqlxb2TO3DqzQrOqoIGLFXGE4KCOcZ8iFFfVtb3ZaYyunlQLQV4frIF 8ez+oliCxkCcOs5RBIf7YbqaC4lYlvq1yrEq3NwVJ8d29KHthppQM1JkiRjXNNhG2Z4PVL5awD3S aY= X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:vts93D9zVJY=:gsEy8BjahHBMP4kVSLvpCF N0ex2GBWMSL3+fHl5kftnbHefYrBHRvt1FaS/vjDL9c5ixFEnSDszDC2W7s5YCAErKgKOGAX7 +ZBcRzisAiI6pwSIxFy4QU8hgWBDPgqS51gBOtrL7xlkSI/S9DE/tbvb+TSX2UcTALwj6InQ7 f+qQcHG/Dj/Vw4c3NQjgMcGGQlvSS9u0OZ/ZPEamZ9XFSrR69F8euKia5cRW5+tNUQTzOfoBe RygDa/LstTCvRJnEZg18oOzNR3Ho9DokkLm0Ft1WlNKfui7Scg4pEXMywoexh0w8EAVefY6Um SiNvw3o+/dyCAj72bzpBBzLcZhydoOrx5YgZ/mQXBsIa2kJwX7FKYFMQe2t4ef0FVhRUcpOPp YiFbVJf+vXU6b6Nb/si8gnmMFuwKiPP6jkWZhTyGRlanzBaHTuS44RxDYBD+C/OndyDb7PH7n D2ZftZ3MAb/1Vcu7mnRY34PezrnnhO9HVV8MYSvN46HMx2OtSbzmO2XvBuSGvLW9ZuAxJnVcf 2DW28PGulku1v7hCgVrG87vHi5rfUZY6ho9MryPyRUQD3PXXCHsBXk92WijEF6E60kIPh6md3 lAurKWmF/Eq1Y= Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=212.227.17.20; envelope-from=nplatiel@gmx.us; helo=mout.gmx.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 18 Jan 2021 02:03:19 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Hello, from the docs: > T label: (test) Branch to label only if there have been no successful > substitutions since the last input line was read or conditional branch w= as > taken. The label may be omitted, in which case the next cycle is started= . According to the above, these two commands should have the same effect, bu= t they don't: $ echo x | sed 's/x/X/ ; T ; aHELLO' # expected X HELLO $ echo x | sed 's/x/X/ ; T ; T ; aHELLO' # unexpected X The second T branch is taken and the 'a' command is skipped, even though n= o new input line was read and no conditional branch was taken after the su= ccessful substitution. I think the docs should be changed because the implemented behavior makes = more sense and I'm already depending on it. The documented behavior is more confusing (asymmetric: t act as a "reset p= oint" but T doesn't), and error prone (less "reset points" means that ther= e is a higher likelihood that older replacements come into play when they = are not meant to). I propose to change "conditional branch was taken" into "conditional branc= h was reached/executed" or something like that. (Any t or T command leaves the "replaced" flag unset, regardless of whethe= r the branch is taken or not.) This was already discussed on sed-devel: https://lists.gnu.org/archive/html/sed-devel/2020-05/msg00001.html https://lists.gnu.org/archive/html/sed-devel/2020-10/msg00006.html Thanks, NP