-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to [email protected] on 1/25/2009 9:15 AM: > If a file has no newline at the end of the last line, the last line > doesn't get counted. As a minimal test case, try > > % echo foo >test && echo -n bar >>test && wc -l test > 1
Not a bug. This behavior is required by POSIX - wc -l is required to count the number of <newline> characters in the file, and is required to operate on non-text files (including files that don't end in a <newline>, in which case the partial text at the end of the file does not count as a line): http://www.opengroup.org/onlinepubs/9699919799/utilities/wc.html - -- Don't work too hard, make some time for fun as well! Eric Blake [email protected] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkl8n8YACgkQ84KuGfSFAYD6fACgxiCMtuMk0O6eFLHifpJ/nmTM dQ0An0ZMM854ecScHkLiZDskuqw6USZc =IgTJ -----END PGP SIGNATURE----- _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
