Date: Sat, 12 Oct 2019 03:04:20 +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@https.bugs.freebsd.org/bugzilla/>
index | next in thread | raw e-mail
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241206 Bug ID: 241206 Summary: sed "a" command issued on the command-line doesn't append a newline Product: Base System Version: 12.0-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: freebsd@tim.thechases.com To reproduce: $ jot 2 | sed '/1/a\ > one point five' Expected results (for comparison, gsed produces this output): 1 one point five 2 Actual results 1 one point five2 If the command is put in a script, it works as expected (though there's also a newline as the last character of the script) $ cat example.sed a\ one point five $ jot 2 | sed -f example.sed 1 one point five 2 Attempts to manually add a newline $ sed '/1/a\ > one point five\ > ' input work for BSD `sed` but then end up adding an extra newline if the same command is issued on a Linux box where sed==gsed. The same also holds for the "c" and "i" commands. As I understand it, the solution would involve noticing that an a/c/i command originates on the command-line and tacking on the extra newline at the end of the provided data. (side note: tested in OpenBSD too and got the same results as FreeBSD) -- You are receiving this mail because: You are the assignee for the bug.help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-241206-227>
