Subject: Re: bug#36204: unmatched `{' with r

From: Assaf Gordon <[email-masked]>
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