4 ms·
From `man wc`: A line is defined as a string of characters delimited by a <newline> character. Characters beyond the final <newline> character will not be
by _jomo 11y ago
From `man wc`:
A line is defined as a string of characters delimited by a <newline> character. Characters beyond the final <newline> character will not be included in the line count.
I first noticed this a few years ago when I tried to count results of some command, for example:
# echo foo | grep bar | wc -l
0
# wc -l <<<"$(echo foo | grep bar)"
1
(Yes I'm aware of grep -c)