NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/45955: sed(1) fails to append newline after 'c' command

>Number:         45955
>Category:       bin
>Synopsis:       sed(1) fails to append newline after 'c' command
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 09 02:00:00 +0000 2012
>Originator:     Jonathan Wakely
>Release:        NetBSD 5.1
NetBSD 5.1 NetBSD 5.1 (GENERIC) #0: Sat Nov 6 13:19:33 UTC 
in the command below sed should:

1) copy 'bar' (without following newline) to pattern space
2) apply 'c' command which:
2a) delete pattern space
2b) print 'bar'
3) print (empty) pattern space
4) append newline

step 4 is missing
echo foo | sed 'c\

expected result is 'bar' followed by newline

actual result is just 'bar'
Explicitly include a newline in the replacement text:

echo foo | sed 'c\

but this produces two newlines on other platforms (e.g. with GNU or Solaris sed)

Home | Main Index | Thread Index | Old Index