bin/82005: wc utility misreports number of lines (zero) in a one line file

Lowell Gilbert freebsd-bugs-local at be-well.no-ip.com
Tue Jun 7 17:50:10 GMT 2005


The following reply was made to PR bin/82005; it has been noted by GNATS.

From: Lowell Gilbert <freebsd-bugs-local at be-well.no-ip.com>
To: Dan Mahoney <danm at prime.gushi.org>
Cc: FreeBSD-gnats-submit at 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 at 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.


More information about the freebsd-bugs mailing list