Quote:
Originally Posted by
MadeInGermany
You say there are awk versions that skip an incomplete line?
Most implementations of wc do so. But awk?
As I said before, the standards only specify the behavior of awk when its input files are text files. Text files have the following constraints:
- they do not contain NUL characters,
- they contain zero or more lines, and
- each line in the file is a string of no more than {LINE_MAX} bytes including a terminating <newline> character.
And I have seen awk implementations that ignore incomplete lines.
The wc utility, on the other hand, is defined to work on any file type; not just text files. If you look at the standards,
wc -l prints a count of <newline> characters found in a file; not the number of lines in a file.