tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

non-POSIX behavior from wc(1)



On NetBSD 6, one gets wc output with pleasing spaces

$ wc -l unison.log cmake.diff
       1 unison.log
      58 cmake.diff
      59 total
$ wc unison.log cmake.diff
       1       7      45 unison.log
      58     168    2461 cmake.diff
      59     175    2506 total
$

But POSIX says:

   "%d %d %d %s\n", <newlines>, <words>, <bytes>, <file>

which does not have extra spaces.  This only matters if you write code
to parse the output based on the spec:

  http://pubs.opengroup.org/onlinepubs/9699919799/utilities/wc.html

So it seems we should adjust wc(1) to note the extra spaces, since it
seems unlikely that we would come to consensus on fixing it.

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index