NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
bin/57252: wc
>Number: 57252
>Category: bin
>Synopsis: wc
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Mar 02 08:05:00 +0000 2023
>Originator: Marc Fege
>Release: 9.3
>Organization:
>Environment:
NetBSD rpi.marc.fege.local 9.3 NetBSD 9.3 (RPI) #0: Thu Aug 4 15:30:37 UTC 2022 mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/evbarm/compile/RPI evbarm
>Description:
Hello alltogether,
the "wc" command does not behave as POSIX demands: POSIX requires the outputted figures to be tabbed by the actual horizontal tab character. Instead, NetBSDs wc implementation fills the empty spaces with the actual space character. I use some shell scripts which should run multiplatform also on Mac, FreeBSD and GNU systems, which follow expected behaviour as POSIX describes. Thus, some workarounds are needed to make things run on NetBSD userlands because of that. This situation seems to be for almost ever, as Microsoft ported their Interix-Unix-Userland taken from NetBSD to Windows-SFU almost 20 years ago, where the exact same behaviour of todays NetBSD could be repeated. I tested this bug also in amd64 and i386 ports. It is a common userland thing in NetBSD and not port specific.
Additionally, when one just ask the word count for example (wc -w), wc replies with in advance whitespaced figures and not with the plain output figure in question, which requires a following 'tr -d "[[:space:]]"' to remove it, which is very inconvinient and unneccessary.
Greetings and much success
Marc.
>How-To-Repeat:
For example:
$ wc /etc/hosts
$ wc -w /etc/hosts
>Fix:
Force spacing between characters with horizontal tab characters.
No Spacing at all when just one output option is requested.
Home |
Main Index |
Thread Index |
Old Index