On Fri, Oct 18, 2019 at 7:30 AM Digital2015 Life <
digital2015.l...@yandex.com> wrote:

The bug is about {n,m} regular expression in ed.
> ed does not recognize 0 in {n,m} which it should.
>

If you read the Posix spec <
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ed.html>, you'll
see that the addresses of lines are positive numbers.  Address 0 is only
valid in six specific places:

0a means "insert at the beginning at the buffer"
0,nc is the same as 1,nc for historical reasons
0i is the same as 1i for historical reasons
m,nm0 means "move lines to before the beginning at the buffer"
0r means "read file and insert it at the beginning at the buffer"
m,nt0 means "copy lines to before the beginning at the buffer"

As you can see, the s command is not included.

The GNU ed manual <
https://www.gnu.org/software/ed/manual/ed_manual.html#Commands> says the
same things, except that it doesn't mention address 0 for the c command
(though it does work as above).



John Cowan          http://vrici.lojban.org/~cowan        co...@ccil.org
Dream projects long deferred usually bite the wax tadpole.
        --James Lileks
_______________________________________________
bug-ed mailing list
bug-ed@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-ed

Reply via email to