"Sowmya Nanjundaiah" <[EMAIL PROTECTED]> wrote:
| I have files which have been FTPd from DOS to Linux. When I use the
| command wc -l on them it gives line count which is less than what is
| actual. If I give nl command it gives proper number of lines. If I
| insert a newline at the end of the file, save it and delete it and save
| it, and then try wc -l command it gives the exact count.
Thanks for the report.
However, `wc -l' counts newlines by definition, and if your
file doesn't end with a newline, then the number reported by
wc will be one less than the number of lines.
$ wc --help
Usage: wc [OPTION]... [FILE]...
Print line, word, and byte counts for each FILE, and a total line if
more than one FILE is specified. With no FILE, or when FILE is -,
read standard input.
-c, --bytes print the byte counts
-m, --chars print the character counts
-l, --lines print the newline counts
...
I just noticed that the above is misleading: the first sentence says that wc
counts lines. I've just changed the --help output: s/line,/newline,/
_______________________________________________
Bug-textutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-textutils