Date: Tue, 7 Jun 2005 17:50:09 GMT From: Lowell Gilbert <freebsd-bugs-local@be-well.no-ip.com> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/82005: wc utility misreports number of lines (zero) in a one line file Message-ID: <200506071750.j57Ho9L4032150@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/82005; it has been noted by GNATS. From: Lowell Gilbert <freebsd-bugs-local@be-well.no-ip.com> To: Dan Mahoney <danm@prime.gushi.org> Cc: FreeBSD-gnats-submit@FreeBSD.org Subject: Re: bin/82005: wc utility misreports number of lines (zero) in a one line file Date: 07 Jun 2005 13:48:42 -0400 Dan Mahoney <danm@prime.gushi.org> writes: > See above. Create a file with no line endings and use wc -l on it. It will return 0 rather than 1. This isn't really a bug. It conforms to the documentation, and to the POSIX specification, which indicate that wc(1) should define a "line" as the number of newlines. In fact, POSIX doesn't even seem to refer to "lines" at all, but just says that "-l" is a count of the "<newlines>" in the input.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200506071750.j57Ho9L4032150>