From owner-freebsd-stable@FreeBSD.ORG Wed Jan 12 07:18:32 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 6B885106566C for ; Wed, 12 Jan 2011 07:18:32 +0000 (UTC) (envelope-from cliftonr@oz.volcano.org) Received: from oz.volcano.org (oz.volcano.org [64.65.105.124]) by mx1.freebsd.org (Postfix) with ESMTP id 3B20C8FC0C for ; Wed, 12 Jan 2011 07:18:31 +0000 (UTC) Received: by oz.volcano.org (Postfix, from userid 1001) id 6686C50824; Tue, 11 Jan 2011 21:00:09 -1000 (HST) Date: Tue, 11 Jan 2011 21:00:09 -1000 From: Clifton Royston To: Oliver Pinter Message-ID: <20110112070009.GB20924@lava.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: stable@freebsd.org 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: Wed, 12 Jan 2011 07:18:32 -0000 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 -- Clifton Royston -- cliftonr@iandicomputing.com / cliftonr@lava.net President - I and I Computing * http://www.iandicomputing.com/ Custom programming, network design, systems and network consulting services