From owner-freebsd-stable@FreeBSD.ORG Thu Jan 13 05:10:23 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B536E106566C for ; Thu, 13 Jan 2011 05:10:23 +0000 (UTC) (envelope-from chris#@1command.com) Received: from mail.1command.com (mail.1command.com [168.103.150.6]) by mx1.freebsd.org (Postfix) with ESMTP id 25FCB8FC15 for ; Thu, 13 Jan 2011 05:10:22 +0000 (UTC) Received: from webmail.1command.com (localhost.1command.com [127.0.0.1]) by mail.1command.com (8.13.3/8.13.3) with ESMTP id p0D5AEvR082201; Wed, 12 Jan 2011 21:10:20 -0800 (PST) (envelope-from chris#@1command.com) Received: from udns0.ultimatedns.net ([168.103.150.26]) (Local authenticated user inf0s) by webmail.1command.com with HTTP; Wed, 12 Jan 2011 21:10:21 -0800 (PST) Message-ID: In-Reply-To: <20110112223229.GB65854@rancor.immure.com> References: <20110112070009.GB20924@lava.net> <20110112223229.GB65854@rancor.immure.com> Date: Wed, 12 Jan 2011 21:10:21 -0800 (PST) From: "Chris H" To: freebsd-stable@freebsd.org User-Agent: HRC Internet Messaging/1.5.2 [SVN] MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit Cc: cliftonr@lava.net 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 05:10:23 -0000 On Wed, January 12, 2011 2: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 root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC >>> i386 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. 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. FWIW On a hunch, I just performed an experimentwith sed(1) against gsed on 50,000 html documents. My mission; to replace all instances of: with: in an effort to see how long it would take to perform the operation for each of the two versions. The results? sed(1) (as provided by the BSD family of operating systems): ~2 seconds gsed: ~4.5 seconds Apologies for the extra noise on the list, but I do a tremendous amount of editing with sed(1) on almost a daily basis. It's a _fantastic_ tool, that saves me _zillions_ of hours. So I'm afraid I become a bit defensive when hearing anyone defame it - it's been like a trusted friend to me. :) --Chris > > > -- > Bob Willcox When the ax entered the forest, the trees said, > bob@immure.com "The handle is one of us!" Austin, TX > -- Turkish proverb > _______________________________________________ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org" > > --