sed is broken under freebsd?

Mark Saad nonesuch at longcount.org
Thu Jan 13 00:36:00 UTC 2011


On Wed, Jan 12, 2011 at 5:32 PM, Bob Willcox <bob at 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     root at almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC
>> >  i386
>> > aa at xxx ~> echo axa | sed s/x/\n/g
>> > ana
>> > aa at xxx ~> echo axa | sed s/x/'\n'/g
>> > ana
>>
>> Different than GNU is not a bug.
>>
>> I have 7.3 here.  It behaves as the above, which is how the man page says it
>> should work.  The following is how the man page specifies you can substitute
>> a newline, by prefacing a quoted actual newline with a backslash:
>>
>> $ echo axa | sed 's/x/\
>> > /g'
>> a
>> a
>>
>>   That's how I remember classic sed behaving (Unix v7 or thereabouts.)
>>   -- 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.



-- 

mark saad | nonesuch at longcount.org


More information about the freebsd-stable mailing list