GNU bug report logs - #50361
Error in first example in documentation

Previous Next

Package: sed;

Reported by: Robert Spanjaard <r.spanjaard <at> arumes.com>

Date: Fri, 3 Sep 2021 19:04:02 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Jim Meyering <jim <at> meyering.net>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#50361: closed (Error in first example in documentation)
Date: Sun, 05 Sep 2021 10:08:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sun, 5 Sep 2021 12:07:31 +0200
with message-id <CA+8g5KE_BL+9WJEnq+GKkza_8KnS7pKV=YrxuK+XfRaO1q8z4Q <at> mail.gmail.com>
and subject line Re: bug#50361: Error in first example in documentation
has caused the debbugs.gnu.org bug report #50361,
regarding Error in first example in documentation
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
50361: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=50361
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Robert Spanjaard <r.spanjaard <at> arumes.com>
To: bug-sed <at> gnu.org
Subject: Error in first example in documentation
Date: Fri, 3 Sep 2021 20:26:19 +0200
On this website...

https://www.gnu.org/software/sed/manual/sed.html#Invoking-sed

In 2.1, the very first example in the documentation states that...

	sed 's/hello/world/' input.txt > output.txt

... replaces ALL occurences of 'hello' to 'world in input.txt.

But the g flag is missing. The provided command only replaces the FIRST 
occurence.

-- 
Kind regards,

Robert Spanjaard


[Message part 3 (message/rfc822, inline)]
From: Jim Meyering <jim <at> meyering.net>
To: Davide Brini <dave_br <at> gmx.com>
Cc: 50361-done <at> debbugs.gnu.org, Robert Spanjaard <r.spanjaard <at> arumes.com>
Subject: Re: bug#50361: Error in first example in documentation
Date: Sun, 5 Sep 2021 12:07:31 +0200
[Message part 4 (text/plain, inline)]
On Sat, Sep 4, 2021 at 6:46 PM Davide Brini <dave_br <at> gmx.com> wrote:
>
>
> (keeping the list in the loop)
>
> On Sat, 4 Sep 2021 17:43:27 +0200, Robert Spanjaard
> <r.spanjaard <at> arumes.com> wrote:
>
> > I'm not a regular sed user. I had an HMTL file that had about 70 list
> > elements on a single line, and I wanted to change that. So I thought I'd
> > use sed to change every occurence of "li><li" into "li>\n<li".
> >
> > sed 's/<\/li><li>/<\/li>\n<li>/' list.html > formattedlist.html
> >
> > According to the manual, this should work. This is exactly what the
> > manual tells me to do to replace *all* occurences in the file list.html.
> >
> > That is NOT a matter of interpretation.
>
> Since I foresee this rapidly becoming a sterile discussion, I'll only add
> this:
>
> for files that do not have multiple occurrences of the same pattern on a
> single line, the statement in the manual is correct. The only thing missing
> is a note specifying just that.
>
> Good luck with your replacements.

Thank you both. I have addressed this and some related (and unrelated
things I noticed along the way) with the attached patch:
[0001-doc-tighten-clarify-wording-e.g.-re-g-modifier.patch (application/octet-stream, attachment)]

This bug report was last modified 3 years and 256 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.