Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Apr 2002 19:28:06 -0400
From:      Aaron Luz <aaron@csh.rit.edu>
To:        freebsd-questions@FreeBSD.ORG
Subject:   Re: sed G?
Message-ID:  <20020423192806.A3933@thud.rochester.rr.com>
In-Reply-To: <20020423130501.GD8750@hades.hell.gr>; from keramida@ceid.upatras.gr on Tue, Apr 23, 2002 at 04:05:02PM %2B0300
References:  <20020421154846.A29729@imsa.edu> <20020423074017.A2763@thud.rochester.rr.com> <20020423130501.GD8750@hades.hell.gr>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020423192806.A3933>