From owner-freebsd-questions Tue Apr 23 16:28:23 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mailout5.nyroc.rr.com (mailout5-1.nyroc.rr.com [24.92.226.169]) by hub.freebsd.org (Postfix) with ESMTP id 2B08B37B400 for ; Tue, 23 Apr 2002 16:28:16 -0700 (PDT) Received: from roc-24-58-68-40.rochester.rr.com (roc-24-58-68-40.rochester.rr.com [24.58.68.40]) by mailout5.nyroc.rr.com (8.11.6/Road Runner 1.12) with ESMTP id g3NNSBH10121 for ; Tue, 23 Apr 2002 19:28:12 -0400 (EDT) Received: from roc-24-58-68-40.rochester.rr.com (localhost [127.0.0.1]) by roc-24-58-68-40.rochester.rr.com (8.12.2/8.12.2) with ESMTP id g3NNS7T7029639 for ; Tue, 23 Apr 2002 19:28:10 -0400 (EDT) (envelope-from aaron@roc-24-58-68-40.rochester.rr.com) Received: (from aaron@localhost) by roc-24-58-68-40.rochester.rr.com (8.12.2/8.12.2/Submit) id g3NNS668029638 for freebsd-questions@FreeBSD.ORG; Tue, 23 Apr 2002 19:28:06 -0400 (EDT) Date: Tue, 23 Apr 2002 19:28:06 -0400 From: Aaron Luz To: freebsd-questions@FreeBSD.ORG Subject: Re: sed G? Message-ID: <20020423192806.A3933@thud.rochester.rr.com> Mail-Followup-To: Aaron Luz , freebsd-questions@FreeBSD.ORG References: <20020421154846.A29729@imsa.edu> <20020423074017.A2763@thud.rochester.rr.com> <20020423130501.GD8750@hades.hell.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020423130501.GD8750@hades.hell.gr>; from keramida@ceid.upatras.gr on Tue, Apr 23, 2002 at 04:05:02PM +0300 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, Apr 23, 2002 at 04:05:02PM +0300, Giorgos Keramidas wrote: > On 2002-04-23 07:40, Aaron Luz wrote: > > On Sun, Apr 21, 2002 at 03:48:46PM -0500, Matthew R. Dietrich wrote: > > > Does anyone understand why "sed G" doesn't doublespace a provided input? It > > > does under other systems I'm aquanted with. Does BSD sed not set the initial > > > hold space to a empty line? I'm running a pretty recent stable... > > > > It seems to work for me. > > It was recently fixed by jmallett, > in src/usr.bin/sed/process.c revision 1.14: > > revision 1.14 > date: 2002/04/05 05:40:20; author: jmallett; state: Exp; lines: +2 -0 > Fix sed(1) behaviour for 'G' when given null holdspace by making sure it > contains a \n. > > PR: misc/26153 > Submitted by: ashp > Reviewed by: mike > Obtained from: NetBSD > MFC after: 2 days Just a quick note: The example I posted should have 16, not 15, lines. I used ksh93 and its builtin version of cat to produce the example. ksh93-20020317 echoed the last line, but didn't number it. Good old /bin/cat numbers the lines correctly. $ print "hello\n" | cat -n | od -c 0000000 1 \t h e l l o \n \n 0000016 $ print "hello\n" | /bin/cat -n | od -c 0000000 1 \t h e l l o \n 0000020 2 \t \n 0000025 Aaron To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message