Closed AtkinsSJ closed 7 months ago
So, there's a little bit of inconsistency here, that I'm uncertain about.
The spec says about -m
:
If the -m option is specified, the number of characters shall replace the
field in this format.
This makes it sound like -c
and -m
are mutually exclusive, but the GNU coreutils implementation of wc
(which is what's on my Linux machine) will output both if both are present. It says:
The counts are printed in this order: newlines, words, characters, bytes, maximum line length.
So, should our wc
behave that way instead? I think I've just persuaded myself that it should.
I agree, we should follow the GNU behavior in this case; it makes a lot more sense.
-c: count bytes -m: count characters (overrides -c) -l: count newlines -w: count words