NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/57252: wc
The following reply was made to PR bin/57252; it has been noted by GNATS.
From: Marc Daniel Fege <marc%fege.net@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: bin/57252: wc
Date: Thu, 02 Mar 2023 12:27:44 +0100
Hello RVP,
> Well, those extra spaces are annoying, but, you can get rid of them
> pretty easily like this:
>=20
> $ x=3D$(x=3D$(wc -l < /etc/motd); echo $x)
> $ echo "$x"
> 8
> $
>=20
thanks a lot for the help. As I understand it =E2=80=93 and I am just a use=
r, not=20
software developer at all =E2=80=93 SUSv4 2018 states something about unpar=
sability of=20
that format. Am I wrong? Therefore: do those annoying spaces need to be the=
re=20
in the first place (to be compatible in one way or another)? The GNU-
implementation is more reasonable in this regard one has to admit. This wou=
ld=20
enable to work out the issue by it's roots and not by a workaround. Sure, t=
his=20
issue is also true with all BSDs due to their common source heritage. But i=
t=20
would be wise to remove those "quirks" anyway so that others do not need to=
=20
figure out the same obstacles again and again. Therefore, make the oval whe=
el=20
actual round and pass it on to the next generations seems to be more=20
sustainable imho -- just a suggestion.
=2D Marc.
Am Donnerstag, 2. M=C3=A4rz 2023, 12:05:01 CET schrieben Sie:
> The following reply was made to PR bin/57252; it has been noted by GNATS.
>=20
> From: RVP <rvp%SDF.ORG@localhost>
> To: gnats-bugs%netbsd.org@localhost
> Cc:
> Subject: Re: bin/57252: wc
> Date: Thu, 2 Mar 2023 11:03:24 +0000 (UTC)
>=20
> On Thu, 2 Mar 2023, Marc Daniel Fege wrote:
> > cat /etc/hosts | wc -w
> >=20
> > produces a more clean output what I mean. I just saw after I checked
> > the=3D20
> > output with an editor that there are just plain space characters and no
> > tab=3D s=3D20
> > and also adds unneccessary empty spaces in advance of that output. Kind
> > of=3D
> > =3D20
> > odd.
>=20
> Well, those extra spaces are annoying, but, you can get rid of them
> pretty easily like this:
>=20
> $ x=3D$(x=3D$(wc -l < /etc/motd); echo $x)
> $ echo "$x"
> 8
> $
>=20
> And, SUSv4 2018 actually recommends a single space instead of tabs:
>=20
> ```
> STDOUT
>=20
> By default, the standard output shall contain an entry for each
> input file of the form:
> "%d %d %d %s\n", <newlines>, <words>, <bytes>, <file>
> ```
>=20
> And,
>=20
> ```
> RATIONALE
>=20
> The output file format pseudo- printf() string differs from the
> System V version of wc:
> "%7d%7d%7d %s\n"
>=20
> which produces possibly ambiguous and unparsable results for very
> large files, as it assumes no number shall exceed six digits.
> ```
>=20
> -RVP
Home |
Main Index |
Thread Index |
Old Index