NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
standards/59960: wc - missing information in man file
>Number: 59960
>Category: standards
>Synopsis: wc - missing information in man file
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: standards-manager
>State: open
>Class: doc-bug
>Submitter-Id: net
>Arrival-Date: Mon Feb 02 20:35:00 +0000 2026
>Originator: Sebastian RItter
>Release:
>Organization:
none
>Environment:
I read the man page and the source code.
>Description:
The man page of wc tool do not note - in different to FreeBSD - that the only last "m or c" flag wins the race.
The source code do it:
https://github.com/NetBSD/src/blob/1d0f224e98c38ff44b6e8b5371ffa141595a286c/usr.bin/wc/wc.c#L93
...
case 'm':
dochar = true;
dobyte = 0;
break;
case 'c':
dochar = 0;
dobyte = true;
break;
The NetBSD documentation writes (https://man.netbsd.org/wc.1):
The following options are available:
...
-c The number of bytes in each input file is written to the standard
output.
-m The number of characters in each input file is written to the
standard output.
...
>How-To-Repeat:
RTFM and source code
>Fix:
Use FreeBSD note:
at -c: This will cancel out any prior usage of the -m option.
at -m This will cancel out any prior usage of the -c option.
or
implementation like GNU wc and remove the cancelation.
Home |
Main Index |
Thread Index |
Old Index