Carlo Wood wrote:
You can argue that this is a feature, but I consider it a bug for all
practical purposes.
POSIX requires that wc -l must just count newlines, so it is indeed a feature.
If wc -l also counted incomplete lines at the end of a file, this would result
in counterintuitive behavior of a different sort. For example:
cat a b >c
wc -l a
wc -l b
wc -l c
Currently the first two numbers must sum to the third, but that would not be
true under the change you're proposing.
Incomplete lines must cause a problem of some sort, and I'm afraid that the
longstanding tradition is to cause the problem you ran into.