sed disappearing last line

2018-07-09 Thread Daniel Bolgheroni
Working with some input/commands which dealt with multiline pattern spaces, noticed a behaviour I was not expecting. Reducing the test to a simple case: $ echo "foo\nbar\nbaz" | sed "1d; N" bar baz $ This is for 3 lines of input. However, same command but for 4 lines of input: $ echo "

Re: sed disappearing last line

2018-07-10 Thread Andreas Kusalananda Kähäri
On Mon, Jul 09, 2018 at 06:23:17PM -0300, Daniel Bolgheroni wrote: > Working with some input/commands which dealt with multiline pattern > spaces, noticed a behaviour I was not expecting. Reducing the test to a > simple case: > > $ echo "foo\nbar\nbaz" | sed "1d; N" > bar > baz > $ > > This

Re: sed disappearing last line

2018-07-10 Thread Andreas Kusalananda Kähäri
On Tue, Jul 10, 2018 at 09:29:55AM +0200, Andreas Kusalananda Kähäri wrote: > On Mon, Jul 09, 2018 at 06:23:17PM -0300, Daniel Bolgheroni wrote: > > Working with some input/commands which dealt with multiline pattern > > spaces, noticed a behaviour I was not expecting. Reducing the test to a > > si

Re: sed disappearing last line

2018-07-10 Thread Daniel Bolgheroni
On Tue, Jul 10, 2018 at 07:34:48AM +, Andreas Kusalananda Kähäri wrote: > On Tue, Jul 10, 2018 at 09:29:55AM +0200, Andreas Kusalananda Kähäri wrote: > > This is really a question about what the "N" command should be doing if > > there is no further input. GNU sed seems to output the current p