Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Jan 2011 19:35:58 -0500
From:      Mark Saad <nonesuch@longcount.org>
To:        stable@freebsd.org
Subject:   Re: sed is broken under freebsd?
Message-ID:  <AANLkTimHnC5uhcOmmmHfG7178Nz6OhaQqfXBT4eG0JE7@mail.gmail.com>
In-Reply-To: <20110112223229.GB65854@rancor.immure.com>
References:  <AANLkTin=Jeah8UX7QB-Uk1x9VYBtnFw=nX8fptLJW%2Bs4@mail.gmail.com> <20110112070009.GB20924@lava.net> <20110112223229.GB65854@rancor.immure.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jan 12, 2011 at 5:32 PM, Bob Willcox <bob@immure.com> wrote:
> On Tue, Jan 11, 2011 at 09:00:09PM -1000, Clifton Royston wrote:
>> On Wed, Jan 12, 2011 at 02:32:52AM +0100, Oliver Pinter wrote:
>> > hi all!
>> >
>> > The freebsd versions of sed contained a bug/regression, when \n char
>> > can i subsitue, gsed not affected with this bug:
>>
>> > FreeBSD xxx 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:55:53
>> > UTC 2010 =C2=A0 =C2=A0 root@almeida.cse.buffalo.edu:/usr/obj/usr/src/s=
ys/GENERIC
>> > =C2=A0i386
>> > aa@xxx ~> echo axa | sed s/x/\n/g
>> > ana
>> > aa@xxx ~> echo axa | sed s/x/'\n'/g
>> > ana
>>
>> Different than GNU is not a bug.
>>
>> I have 7.3 here. =C2=A0It behaves as the above, which is how the man pag=
e says it
>> should work. =C2=A0The following is how the man page specifies you can s=
ubstitute
>> a newline, by prefacing a quoted actual newline with a backslash:
>>
>> $ echo axa | sed 's/x/\
>> > /g'
>> a
>> a
>>
>> =C2=A0 That's how I remember classic sed behaving (Unix v7 or thereabout=
s.)
>> =C2=A0 -- Clifton
>
> FWI, AIX 6.1 sed works as the FreeBSD sed does.


 Solaris 2.6 and OSX 10.6 , do the same thing as FreeBSD as well.



--=20

mark saad | nonesuch@longcount.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimHnC5uhcOmmmHfG7178Nz6OhaQqfXBT4eG0JE7>