On 29/11/15 06:34, Assaf Gordon wrote: > On 11/29/2015 12:16 AM, Pádraig Brady wrote: > >>> I must collate some gotchas like this. >> >> Initial list started at: >> http://www.pixelbeat.org/docs/coreutils-gotchas.html >> > > Fantastic list! > > I would suggest adding four 'wc' entries: > > 1. "wc -l" on a file with text but no new-line character will return zero. > > $ printf "hello world" | wc -l > 0 > > 2. "wc -l" on a file in which the last line doesn't end with NL > will return a value of one-less than naively expected: > > $ printf "hello\nworld" | wc -l > 1
This is the general case of 1. It also applies to tac at least: $ printf "1\n2" | tac 21 The other points are not unexpected I think given that -L counts display width. But we did explain that badly thought for a long time :) http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v8.23-190-g79111d1 I've noted that better explanation in the list. thanks, Pádraig.
