[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: uniq -c outputs SPACES NUMBER TAB LINE
From: |
Leif LeBaron |
Subject: |
Re: uniq -c outputs SPACES NUMBER TAB LINE |
Date: |
Wed, 25 Feb 2009 10:27:58 -0800 |
> Why do you think it's a bug?
I imagine the insertion of leading spaces was deliberate, but I refer to it as
bug because it has already been registered as such in your bug tracker, and
also for the following reasons.
- It appears to be undocumented (I checked both, man and info pages).
- It appears to violate susv3
(<http://www.opengroup.org/onlinepubs/009695399/utilities/uniq.html>) which
clearly states:
If the -c option is specified, the output file shall be empty or each
line shall be of the form:
"%d %s", <number of duplicates>, <line>
- It breaks other commands, for example:
This should work:
cat textfile | sort | uniq -c | cut -d " " -f 2-
But instead the leading spaces must first be removed:
cat textfile | sort | uniq -c | sed 's/^[ \t]*//' | cut -d " "
-f 2-
> Please reply not to me directly, but rather to the
> address@hidden mailing list.
By the way, I replied using the button on the website
<http://lists.gnu.org/archive/html/bug-textutils/2003-07/msg00013.html> (so,
you may want to change that address).
Please confirm that this message has been received.
Thanks,
Leif
- Re: uniq -c outputs SPACES NUMBER TAB LINE,
Leif LeBaron <=