Subject: bin/7674: 'sed G' output missing newline
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jpeek@jpeek.com>
List: netbsd-bugs
Date: 05/30/1999 21:20:53
>Number:         7674
>Category:       bin
>Synopsis:       'sed G' doesn't output newline when hold space is empty
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 30 21:20:01 1999
>Last-Modified:
>Originator:     Jerry Peek
>Organization:
Jerry Peek, jpeek@jpeek.com, http://www.jpeek.com/~jpeek/
>Release:        NetBSD-current as of 11 hours ago
>Environment:
	
System: NetBSD hrothgar.gw.com 1.3H NetBSD 1.3H (TAC-GENERIC) #2: Sun Nov 1 14:11:13 EST 1998 kim@hrothgar.gw.com:/net/hrothgar/src-1/NetBSD/cvsroot/src/sys/arch/i386/compile/TAC-GENERIC i386


>Description:
	The following command should doublespace a file named "filename":

	      sed G filename

	This has worked for years on many other systems.  (Kimmo Suominen
	confirmed that it works on GNU sed 3.02, GNU sed 2.05, and all
	Solaris 2.6 sed versions: /usr/xpg4/bin/sed, /usr/ucb/sed, and
	/usr/bin/sed (/usr/5bin/sed is the same binary).  I'm almost
	certain that it worked correctly on 4.3 BSD and before.

	The NetBSD sed(1) manpage agrees:

	  [2addr]G
	       Append a newline character followed by the contents of
	       the hold space to the pattern space

	If the hold space is empty, the G command should still put a
	newline before the (empty) hold space.  That's how this works.

>How-To-Repeat:
	Try a command like:

		head /etc/passwd | sed G

	on other UNIXes, you should get 20 lines of output: 10 from
	head and 10 empty lines.  On NetBSD, you'll get just the 10
	lines from head.
>Fix:
	
>Audit-Trail:
>Unformatted: