On 2/6/23 11:38, Pádraig Brady wrote:
Note also if you really want to read, you can always `cat | wc -c`
rather than just `wc -c`

Even that's not guaranteed, as 'cat' is not required to use the 'read' system call if it can determine that the standard input contains only NULs without calling 'read'. (GNU 'cat' doesn't do this, but POSIX allows it.)

We shouldn't complicate 'wc' (thus slowing it down and worse, possibly introducing a bug) if the only goal is to make 'wc' fail more often in implausible scenarios.



Reply via email to