Date: Wed, 15 Dec 2021 20:55:34 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 241206] sed "a" command issued on the command-line doesn't append a newline Message-ID: <bug-241206-227-O2xZL5rL65@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-241206-227@https.bugs.freebsd.org/bugzilla/> References: <bug-241206-227@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D241206 jwdevel@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jwdevel@gmail.com --- Comment #1 from jwdevel@gmail.com --- I'm not sure this is a bug, just a difference in behavior between GNU sed a= nd BSD sed (of which there are many). The docs for 'a' in "man 1 sed" say: "Write text to standard output immedia= tely before each attempt to read a line of input". In my reading of that, since "text" does not contain a newline, neither does the output. You probably already know this, but this works in both cases: $ jot 2 | sed '/1/a\ > one point five > ' (That is, type the extra newline in your shell, before adding the terminati= ng single-quote. This is the same as in your script example.) Though that might technically run afoul of GNU sed's documentation, which s= ays "Append text, which has each embedded newline preceded by a backslash." I just put a raw newline there, not preceded by backslash. It does work though, regardless. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-241206-227-O2xZL5rL65>