From owner-freebsd-stable@FreeBSD.ORG Thu Jan 13 00:36:00 2011 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AAEA1065673 for ; Thu, 13 Jan 2011 00:36:00 +0000 (UTC) (envelope-from nonesuch@longcount.org) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id B94D08FC1D for ; Thu, 13 Jan 2011 00:35:59 +0000 (UTC) Received: by bwz12 with SMTP id 12so1013102bwz.13 for ; Wed, 12 Jan 2011 16:35:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.81.72 with SMTP id w8mr1275959bkk.205.1294878958392; Wed, 12 Jan 2011 16:35:58 -0800 (PST) Received: by 10.204.151.212 with HTTP; Wed, 12 Jan 2011 16:35:58 -0800 (PST) X-Originating-IP: [68.239.208.169] In-Reply-To: <20110112223229.GB65854@rancor.immure.com> References: <20110112070009.GB20924@lava.net> <20110112223229.GB65854@rancor.immure.com> Date: Wed, 12 Jan 2011 19:35:58 -0500 Message-ID: From: Mark Saad To: stable@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: sed is broken under freebsd? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jan 2011 00:36:00 -0000 On Wed, Jan 12, 2011 at 5:32 PM, Bob Willcox 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