GNU bug report logs - #28468
Bug in wc -l found

Previous Next

Package: coreutils;

Reported by: "Weidner, Robert (I/EE-31, extern)" <extern.robert.weidner <at> audi.de>

Date: Fri, 15 Sep 2017 15:38:02 UTC

Severity: normal

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #16 received at 28468-done <at> debbugs.gnu.org (full text, mbox):

From: Assaf Gordon <assafgordon <at> gmail.com>
To: "Weidner, Robert (I/EE-31, extern)" <extern.robert.weidner <at> audi.de>,
 28468-done <at> debbugs.gnu.org
Subject: Re: bug#28468: Bug in wc -l found
Date: Fri, 15 Sep 2017 09:55:16 -0600
tag 28468 notabug
stop

Hello Rob,

On 2017-09-15 03:03 AM, Weidner, Robert (I/EE-31, extern) wrote:
> seems I found a bug in wc, have a look:

[[
the attach screen shot shows:
    $ wc -l monitore-serNr_all-run2.txt
    16
while the attached file appears to have 17 lines.
]]

This is not a bug, but the expected behavior.
The file you attached does not have a '\n' character
at the end of the last line.

Technically, 'wc' counts the number of '\n' characters,
not the number of appeared lines.

This is explained here:
   http://www.pixelbeat.org/docs/coreutils-gotchas.html#wc


As such, I'm marking this as not-a-bug, but discussion can
continue by replying to this thread.

regards,
 - assaf





This bug report was last modified 7 years and 307 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.