Subject: Re: bug#28468: Bug in wc -l found
From: Assaf Gordon <[email-masked]>
To: "Weidner, Robert (I/EE-31, extern)" <[email-masked]>, [email-masked]
Date: Fri, 15 Sep 2017 09:55:16 -0600
List-Id: <debbugs-submit.debbugs.gnu.org>

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