[Bug 279223] sed - "a\" command displays different results depending on use of -e option (closing new line)
Date: Wed, 22 May 2024 22:25:44 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279223 Eric Vermetten <ericvermetten@online.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ericvermetten@online.nl --- Comment #2 from Eric Vermetten <ericvermetten@online.nl> --- In addition to previous comment: sed '/1/a\ -new line- ' <t results in: 1 -new line- 2 as do all variations over: - double double quotes vs single quotes, - sed vs gsed, - option -e present vs not present. Implicit description of its intended <EOL> behaviour, is mentioned in: sed & awk, 2nd edition; Arnold Robbin, Dale Dougherty at the "Command Summary for sed": " a [address]a\ text Append text following each line matched by address. If text goes over more than one line, newlines must be "hidden" by preceding them with a backslash. The text will be terminated by the first newline that is not hidden in this way. The text is not available in the pattern space and subsequent commands cannot be applied to it. The results of this command are sent to standard output when the list of editing commands is finished, regardless of what happens to the current line in the pattern space. " -- You are receiving this mail because: You are the assignee for the bug.