From unknown Sat Jun 14 03:46:16 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#64539 <64539@debbugs.gnu.org> To: bug#64539 <64539@debbugs.gnu.org> Subject: Status: Possible issue with GNU sed documentation regarding the -n option Reply-To: bug#64539 <64539@debbugs.gnu.org> Date: Sat, 14 Jun 2025 10:46:16 +0000 retitle 64539 Possible issue with GNU sed documentation regarding the -n op= tion reassign 64539 sed submitter 64539 =C3=82ngelo Ot=C3=A1vio Nuffer Nunes severity 64539 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 09 05:08:00 2023 Received: (at submit) by debbugs.gnu.org; 9 Jul 2023 09:08:00 +0000 Received: from localhost ([127.0.0.1]:45833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIQOb-00036F-Hy for submit@debbugs.gnu.org; Sun, 09 Jul 2023 05:08:00 -0400 Received: from lists.gnu.org ([209.51.188.17]:39138) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIGWb-0000zT-MH for submit@debbugs.gnu.org; Sat, 08 Jul 2023 18:35:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qIGWb-0002d4-9n for bug-sed@gnu.org; Sat, 08 Jul 2023 18:35:33 -0400 Received: from mail-qv1-xf2c.google.com ([2607:f8b0:4864:20::f2c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qIGWZ-00061Q-6a for bug-sed@gnu.org; Sat, 08 Jul 2023 18:35:32 -0400 Received: by mail-qv1-xf2c.google.com with SMTP id 6a1803df08f44-63759b5983dso19108896d6.0 for ; Sat, 08 Jul 2023 15:35:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688855729; x=1691447729; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=/fEgBDZjHKUwgUqqkiTXmA2pba/2cpeMzWA6gemzeho=; b=hIa8fZVnN8yHYbCbgI+AFNsKs+8nh0wNkqxU7zSYsMYV69ZvB/w0HyPyNN/C58L8d7 R/0QA4t1ROmbTZqwrK+rFiTE8kbYKi9byPSu6cAo7uhD2b9IkqhL8GS/XLlHpWgMc/WS dyapG4c5rwVLsavMjugxjXGwappzrYTJ96VLGGL369oVvjTaGobHGSODP7S0G2VJb+F+ d43Rd0r4rihPdqtvGIm/XpvU1dKApZMmwMn3NhnSoD/+l82IC514DVHPDXHVy5hToQOv weoasYKR65IaC2/65Ml1df6CeSNVRcVAMd/S5RkGGyv7qHTHMWJTxSyM8CQUrLzs1dtL S/2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688855729; x=1691447729; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=/fEgBDZjHKUwgUqqkiTXmA2pba/2cpeMzWA6gemzeho=; b=SNTJmxUKNLC4sbR4tYZeTulaonNgZvr1FaUDcZAHpeYSV2KMVEdD0GofMFU9sQiJLN w9UJ4QUUCYLlB5Lzs6vMRfE051reBfCqUcJSZrNaBjzRpn70cFj33JATX76eBAEdwLLx lxeMwWYkDIOjjUeWya12cltueyRVv0W/XYqARSf/f+bRTIhM5k6gQ1bOOzKWh8n9Y2vl mgIv2fpxYr0DcJbv0xW4MhPkoBhKhh1tmwBlAKGVsIS93DgyKXQ8uzaBks5FrbKPqX1/ fZU34g/O01xkgHOC/Uv5GigsGN7CoCWHw7+6bhZsxKRJ60NeuidM5eIBFFPJrkAPFx/O 72CA== X-Gm-Message-State: ABy/qLYcel6KhsYxg/iV579QmE27I7aA0ayt2X6vXxxCrDVotHqE/GR2 EVZB/dj7yw/bO8wwuk5r5RR1WNmbS9BaUUAIK3CSgcaICmsB+A== X-Google-Smtp-Source: APBJJlETkwauLCd7CStz+F4rrdA8xlQEn+SD+gTIjgSTuXwXIDSeEZjBn3E6tyRIqTgaXaDYQFyzViopsgdz6cMbqKA= X-Received: by 2002:a0c:ac0e:0:b0:637:2dd2:755b with SMTP id l14-20020a0cac0e000000b006372dd2755bmr6219684qvb.36.1688855729554; Sat, 08 Jul 2023 15:35:29 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?Q?=C3=82ngelo_Ot=C3=A1vio_Nuffer_Nunes?= Date: Sat, 8 Jul 2023 19:35:18 -0300 Message-ID: Subject: Possible issue with GNU sed documentation regarding the -n option To: bug-sed@gnu.org Content-Type: multipart/alternative; boundary="000000000000d64bc20600015d3e" Received-SPF: pass client-ip=2607:f8b0:4864:20::f2c; envelope-from=angelonuffer@gmail.com; helo=mail-qv1-xf2c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 09 Jul 2023 05:07:54 -0400 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.3 (--) --000000000000d64bc20600015d3e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dear GNU sed maintainers, I am writing to report a possible issue with the documentation for the `-n` option in GNU `sed`. According to the documentation available at https://www.gnu.org/software/sed/manual/html_node/Command_002dLine-Options.= html, the `-n` option should cause `sed` to only produce output when explicitly told to via the `p` command. However, based on responses and comments on this Stack Overflow post ( https://stackoverflow.com/questions/76633771/why-does-gnu-sed-print-output-= when-using-the-n-option-with-the-a-command/76639116#76639116) and my own tests, it appears that several other commands, including `=3D`, `l`, `r`, `a`, `i`, and `c`, also produce output even when the `-n` option is used. I am still learning how to use GNU `sed`, so I may be misunderstanding something. However, I wanted to bring this to your attention in case there is an issue with the documentation that needs to be addressed. Thank you for your time and for all the work you do on GNU `sed`. Best regards, =C3=82ngelo Nuffer --000000000000d64bc20600015d3e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Dear GNU sed maintainers,

I am writing to report a po= ssible issue with the documentation for the `-n` option in GNU `sed`. Accor= ding to the documentation available at https://www.gnu.org= /software/sed/manual/html_node/Command_002dLine-Options.html, the `-n` = option should cause `sed` to only produce output when explicitly told to vi= a the `p` command.

However, based on responses and comments on this = Stack Overflow post (https://stackoverflow.com/questions/76633771/why-does-gn= u-sed-print-output-when-using-the-n-option-with-the-a-command/76639116#7663= 9116) and my own tests, it appears that several other commands, includi= ng `=3D`, `l`, `r`, `a`, `i`, and `c`, also produce output even when the `-= n` option is used.

I am still learning how to use GNU `sed`, so I ma= y be misunderstanding something. However, I wanted to bring this to your at= tention in case there is an issue with the documentation that needs to be a= ddressed.

Thank you for your time and for all the work you do on GNU= `sed`.

Best regards,
=C3=82ngelo Nuffer
<= /div> --000000000000d64bc20600015d3e-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 24 05:19:56 2024 Received: (at 64539) by debbugs.gnu.org; 24 Jul 2024 09:19:56 +0000 Received: from localhost ([127.0.0.1]:33125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sWYA8-0003lA-8C for submit@debbugs.gnu.org; Wed, 24 Jul 2024 05:19:56 -0400 Received: from cventin.lip.ens-lyon.fr ([140.77.13.17]:48392) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sWYA6-0003l2-CF for 64539@debbugs.gnu.org; Wed, 24 Jul 2024 05:19:55 -0400 Received: from vlefevre by cventin.lip.ens-lyon.fr with local (Exim 4.98) (envelope-from ) id 1sWY9z-00000000XQu-1DRp; Wed, 24 Jul 2024 11:19:47 +0200 Date: Wed, 24 Jul 2024 11:19:47 +0200 From: Vincent Lefevre To: =?iso-8859-1?Q?=C2ngelo_Ot=E1vio?= Nuffer Nunes Subject: Re: Possible issue with GNU sed documentation regarding the -n option Message-ID: <20240724091947.GA127799@cventin.lip.ens-lyon.fr> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/2.2.13+77 (9dc98409) vl-169878 (2024-06-20) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64539 Cc: 64539@debbugs.gnu.org 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: -1.0 (-) Hi, On 2023-07-08 19:35:18 -0300, Ângelo Otávio Nuffer Nunes wrote: > I am writing to report a possible issue with the documentation for the `-n` > option in GNU `sed`. According to the documentation available at > https://www.gnu.org/software/sed/manual/html_node/Command_002dLine-Options.html, > the `-n` option should cause `sed` to only produce output when explicitly > told to via the `p` command. > > However, based on responses and comments on this Stack Overflow post ( > https://stackoverflow.com/questions/76633771/why-does-gnu-sed-print-output-when-using-the-n-option-with-the-a-command/76639116#76639116) > and my own tests, it appears that several other commands, including `=`, > `l`, `r`, `a`, `i`, and `c`, also produce output even when the `-n` option > is used. Perhaps the doc of -n implicitly means that this is specifically the output of the current pattern space at the end of a cycle (as done by default, which is what this paragraph is about). Said otherwise, with the -n option, to get the same behavior as the default one, one would need a p command at the end of the script. I think that "via the p command" could be removed, or "for example" could be added. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)