tag 9019 notabug thanks On 07/07/2011 02:31 AM, Andrey Sheyko wrote: > Hello! > I've found out that wc -l doen't count the last line if there is no CR in the > end of line
Thanks for the report. However, this is not a bug, but a requirement of POSIX. Furthermore, I think you meant NL, not CR. http://pubs.opengroup.org/onlinepubs/9699919799/utilities/wc.html "-l Write to the standard output the number of <newline> characters in each input file. ... Early proposals only specified the results when input files were text files. The current specification more closely matches historical practice. (Bytes, words, and <newline> characters are counted separately and the results are written when an end-of-file is detected.)" A file that does not end in a newline is _not_ a text file, and the partial data is _not_ counted as a line according to historical practice. > This message contains confidential information of Scartel, Ltd. It is considered poor netiquette to send emails to publicly archived lists with disclaimers like this, since the very nature of public archival makes this clause unenforceable. You are better off using a secondary account that does not add your employer's disclaimer on the end. -- Eric Blake [email protected] +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
