GNU bug report logs - #36202
Add example of how to write the two addresses

Previous Next

Package: sed;

Reported by: Dan Jacobson <jidanni <at> jidanni.org>

Date: Thu, 13 Jun 2019 23:54:02 UTC

Severity: wishlist

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #18 received at control <at> debbugs.gnu.org (full text, mbox):

From: Assaf Gordon <assafgordon <at> gmail.com>
To: Dan Jacobson <jidanni <at> jidanni.org>
Cc: 36204 <at> debbugs.gnu.org
Subject: Re: bug#36204: unmatched `{' with r
Date: Sat, 29 Jun 2019 01:56:16 -0600
close 36202
stop

Hello,

On Thu, Jun 13, 2019 at 08:03:41PM +0800, Dan Jacobson wrote:
> $ seq 3 | sed -n '2{s/2/X/ ; r /dev/null }'
> sed: -e expression #1, char 0: unmatched `{'
> $ seq 3 | sed -n '2{s/2/X/ ; r /dev/null ; }'
> sed: -e expression #1, char 0: unmatched `{'
> 
> If r is special and needs a terminating newline for some reason, then
> please mention it on the r documentation, and show how to make the above
> one liner work.
> 

There is a section in the manual about writing multiple sed commands in
a script [1], and a dedicate sub-section for commands that require a
newline (including 'r') [2].

[1] https://www.gnu.org/software/sed/manual/sed.html#Multiple-commands-syntax
[2] https://www.gnu.org/software/sed/manual/sed.html#Commands-Requiring-a-newline

As such, I'm closing this item, but discussion can continue by replying
to this thread (concrete patches to improve the manual are always
welcomed).

regards,
 - assaf




This bug report was last modified 6 years and 27 days ago.

Previous Next


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