From nobody@FreeBSD.org  Wed Mar  3 07:31:56 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B26A3106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  3 Mar 2010 07:31:56 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id A18138FC15
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  3 Mar 2010 07:31:56 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o237VuQk036456
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 3 Mar 2010 07:31:56 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o237VuPX036455;
	Wed, 3 Mar 2010 07:31:56 GMT
	(envelope-from nobody)
Message-Id: <201003030731.o237VuPX036455@www.freebsd.org>
Date: Wed, 3 Mar 2010 07:31:56 GMT
From: Garrett Cooper <yaneurabeya@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Confusing error message from sed with 's/.*/d' ": unescaped newline inside substitute pattern
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         144441
>Category:       bin
>Synopsis:       sed(1): Confusing error message from sed with 's/.*/d' ": unescaped newline inside substitute pattern
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 03 07:40:01 UTC 2010
>Closed-Date:    Thu Jul 01 15:46:47 UTC 2010
>Last-Modified:  Sun Feb 03 22:28:10 UTC 2013
>Originator:     Garrett Cooper
>Release:        RELENG_8
>Organization:
Cisco Systems, Inc
>Environment:
FreeBSD garrcoop-fbsd.cisco.com 8.0-STABLE FreeBSD 8.0-STABLE #2: Wed Feb  3 16:57:07 PST 2010     garrcoop@garrcoop-fbsd.cisco.com:/usr/obj/usr/src/sys/LAPPY_X86  i386
>Description:
I accidentally misread a web document and thus provided incorrect input to sed. BSD sed failed with a confusing message, but GNU sed led me on to the right track:

[garrcoop@garrcoop-fbsd /usr/home/garrcoop]$ sed -i "" -e 's/games:/d' /etc/passwd 
sed: 1: "s/games:/d
": unescaped newline inside substitute pattern
[garrcoop@garrcoop-fbsd /usr/home/garrcoop]$ sed -i "" -e '/games:/d' /etc/passwd 
sed: /etc/passwd: Permission denied

I'm confused where the newline is coming into play.
>How-To-Repeat:
sed 's/games:/d' /etc/passwd
>Fix:


>Release-Note:
>Audit-Trail:

From: Garrett Cooper <yaneurabeya@gmail.com>
To: bug-followup@FreeBSD.org, gcooper@FreeBSD.org
Cc: dds@freebsd.org
Subject: Re: bin/144441: sed(1): Confusing error message from sed with 
	's/.*/d' ": unescaped newline inside substitute pattern
Date: Mon, 15 Mar 2010 03:41:44 -0700

     Someone appears to have inadvertently fixed this between 8.x and CURRENT:
 
 [gcooper@bayonetta
 /scratch/src/head/tools/regression/usr.bin/hexdump]$ sed 's/games:/d'
 /etc/passwd
 sed: 1: "s/games:/d": unterminated substitute in regular expression
 [gcooper@bayonetta /scratch/src/head/tools/regression/usr.bin/hexdump]$ uname -a
 FreeBSD bayonetta.localdomain 9.0-CURRENT FreeBSD 9.0-CURRENT #2: Thu
 Mar  4 13:16:39 PST 2010
 gcooper@bayonetta.localdomain:/usr/obj/usr/src/sys/BAYONETTA  amd64
 
     This statement makes much more logical sense than the one
 currently reported in 8-STABLE.
     I believe r197362 did the trick, but I need to verify whether or
 not this is true. If it isn't that change then it's most likely
 r197361.
 Thanks,
 -Garrett

From: Garrett Cooper <yaneurabeya@gmail.com>
To: bug-followup@FreeBSD.org, gcooper@FreeBSD.org
Cc:  
Subject: Re: bin/144441: sed(1): Confusing error message from sed with 
	's/.*/d' ": unescaped newline inside substitute pattern
Date: Sun, 27 Jun 2010 12:44:28 -0700

 Please close this PR as it will be resolved in 8.1.
 Thanks,
 -Garrett
State-Changed-From-To: open->closed 
State-Changed-By: jh 
State-Changed-When: Thu Jul 1 15:46:46 UTC 2010 
State-Changed-Why:  
Closed at submitter's request. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=144441 
>Unformatted:
