bug-ed
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-ed] Different behavior GNU ed and oed


From: Alexander Jones
Subject: Re: [Bug-ed] Different behavior GNU ed and oed
Date: Thu, 28 Feb 2019 17:21:29 -0600

On Thursday, February 28, 2019 4:29:24 PM CST Bjoern Wibben wrote:
> Hi there,
> 
> I found a different behavior between ed and oed.
> 
> Have a look at the output below:
> 
> oed (https://github.com/ibara/oed <https://github.com/ibara/oed>):
> 
> ~$ oed
> 
> :a
> 
> this
> is
> a
> test
> tester
> .
> 
> :g/test/s/^/#/g
> :,n
> 
> 1       this
> 2       is
> 3       a
> 4       #test
> 5       #tester
> 
> :Q
> 
> GNU ed 1.14.2 and 1.15:
> 
> ~$ ged
> 
> :a
> 
> this
> is
> a
> test
> tester
> .
> 
> :g/test/s/^/#/g
> 
> ?
> 
> :H
> 
> infinite substitution loop
> 
> :Q
> 
> As you can see oed is doing the substitution while GNU ed is not.
> GNU ed will do the substitution if you skip the last g.
> 
> 
> Best regards,
> 
> Bjoern
> 
> ---
> Bjoern M. Wibben
> Taunusstr. 112 - 61440 Oberursel - Phone: 0.61.71/208.173.8
> http://www.wibben.de/ <http://www.wibben.de/>     mailto:address@hidden
> <mailto:address@hidden> GPG-Fingerprint: EF66 E41D A051 A370 9757 CD24 EE3D
> 85DF 2E24 3867
> 
> _______________________________________________
> bug-ed mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/bug-ed

This is a problem with 's', not with 'g'. A command like '4s/^/#/g' also fails 
with the same error. It seems to be an issue with using '^' by itself, as 
something like '4s/^t/#t/g' works.

Alexander





reply via email to

[Prev in Thread] Current Thread [Next in Thread]