Post History
I’ve had some tools drop the last incomplete line on some OSes. For example: $ printf 'foo\nbar\nbaz' | sed 's/x/y/' foo bar $ _ I don’t recall which systems exactly these were, but I know ...
Answer
#1: Initial revision
I’ve had some tools drop the last incomplete line on some OSes. For example: $ printf 'foo\nbar\nbaz' | sed 's/x/y/' foo bar $ _ I don’t recall which systems exactly these were, but I know I ran into it multiple times over the years, and POSIX allows this (I checked, it’s the application’s/user’s duty to provide the final newline).