bin/144441: Confusing error message from sed with 's/.*/d' ":
unescaped newline inside substitute pattern
Garrett Cooper
gcooper at FreeBSD.org
Wed Mar 3 07:40:02 UTC 2010
>Number: 144441
>Category: bin
>Synopsis: Confusing error message from sed with 's/.*/d' ": unescaped newline inside substitute pattern
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Mar 03 07:40:01 UTC 2010
>Closed-Date:
>Last-Modified:
>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 at 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 at garrcoop-fbsd /usr/home/garrcoop]$ sed -i "" -e 's/games:/d' /etc/passwd
sed: 1: "s/games:/d
": unescaped newline inside substitute pattern
[garrcoop at 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:
>Unformatted:
More information about the freebsd-bugs
mailing list