https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=249522
Bug ID: 249522
Summary: wc(1) prints leading spaces before the count, which
appears to not be POSIX-compliant
Product: Base System
Version: CURRENT
Hardware: Any
OS: Any
Status: New
Keywords: standards
Severity: Affects Only Me
Priority: ---
Component: bin
Assignee: [email protected]
Reporter: [email protected]
This document[1] suggests that there should be no leading whitespace characters
printed before the count. Also, this is how GNU wc behaves, e.g.:
```
$ echo 123 | wc -c
4
```
The FreeBSD wc(1) works like this, however:
```
$ echo 123 | wc -c
4
```
Our behaviour tends to be the source of bugs when people try to do things like
this:
```
if [ "$(wc -l file)" -gt 10 ]; then ...
```
[1]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/wc.html
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"