[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: e, r and w cannot be followed by semicolons as well
From: |
Jim Meyering |
Subject: |
Re: e, r and w cannot be followed by semicolons as well |
Date: |
Mon, 3 Feb 2025 15:00:16 -0800 |
On Tue, Jan 21, 2025 at 9:12 AM Arkadiusz Drabczyk
<arkadiusz@drabczyk.org> wrote:
> In doc/sed.texi it says:
>
> > Commands @command{a}, @command{c}, @command{i}, due to their syntax,
> > cannot be followed by semicolons working as command separators and
> > thus should be terminated with newlines or be placed at the end of a
> > @var{script} or @var{script-file}.
>
> Should e, r and w be mentioned here as well? They cannot be followed
> by a semicolon:
>
> $ seq 1 10 | sed '10 e date; 1 s/1/-1/'
> 1
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
> sh: line 1: 1: command not found
> Tue Jan 21 17:44:01 CET 2025
>
> $ seq 1 10 | sed '10 r /proc/version; 1 s/1/-1/'
> 1
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
> 10
>
> $ seq 1 10 | sed '10 w HERE; 1 s/1/-1/'
> sed: couldn't open file HERE; 1 s/1/-1/: No such file or directory
Thanks. That is a good suggestion. Do you want to write a diff
updating the documentation?
- Re: e, r and w cannot be followed by semicolons as well,
Jim Meyering <=