bug-sed
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#64539: Possible issue with GNU sed documentation regarding the -n op


From: Vincent Lefevre
Subject: bug#64539: Possible issue with GNU sed documentation regarding the -n option
Date: Wed, 24 Jul 2024 11:19:47 +0200
User-agent: Mutt/2.2.13+77 (9dc98409) vl-169878 (2024-06-20)

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 <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]