Bug 112952 - sed 4.0.8 and t command
Summary: sed 4.0.8 and t command
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: sed
Version: 1
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-01-06 16:43 UTC by Derrien
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version: 4.0.8-3
Clone Of:
Environment:
Last Closed: 2004-01-07 14:47:52 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Derrien 2004-01-06 16:43:15 UTC
Description of problem:

On RH 9 with sed 4.0.5 :

echo "a
b" | sed '{:bcl;N;s/\n/ /;t bcl}'

gives : 
a b

On FC 1 with sed 4.0.8

echo "a
b" | sed '{:bcl;N;s/\n/ /;t bcl}'

gives nothing

So what ?




Version-Release number of selected component (if applicable):
sed-4.0.8-2

How reproducible:
Always

Steps to Reproduce:
1.Cf description
2.
3.
    

Additional info:

Comment 1 Jakub Jelinek 2004-01-06 23:00:09 UTC
My understanding of
http://www.opengroup.org/onlinepubs/007904975/utilities/sed.html
is that the latter behaviour is correct.
"If no next line of input is available, the N command verb shall branch to the end of the script and quit without
starting a new cycle or copying the pattern space to standard output."

Comment 2 Derrien 2004-01-07 12:57:36 UTC
From /usr/share/doc/sed-4.0.8/BUGS :

* NON-BUGS
...
`N' command on the last line

  Most versions of sed exit without printing anything when the `N'
  command is issued on the last line of a file.  GNU sed instead
  prints pattern space before exiting unless of course the `-n'
  command switch has been specified.  More information on the reason
  behind this choice can be found in the Info manual.


Comment 3 Jakub Jelinek 2004-01-07 14:47:52 UTC
Paolo Bonzini (sed maintainer) provided a patch which restores the
old N behaviour unless POSIXLY_CORRECT is set in the environment.
The patch is included in sed-4.0.8-3 in rawhide.


Note You need to log in before you can comment on or make changes to this bug.