GNU bug report logs - #6949
Uniq command should allow total to be displayed

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: coreutils; Severity: wishlist; Reported by: "Miles Duke" <Miles.Duke@HIDDEN>; dated Mon, 30 Aug 2010 15:43:01 UTC; Maintainer for coreutils is bug-coreutils@HIDDEN.

Message received at 6949 <at> debbugs.gnu.org:


Received: (at 6949) by debbugs.gnu.org; 30 Aug 2010 21:03:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 30 17:03:03 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1OqBVO-0008PO-Tx
	for submit <at> debbugs.gnu.org; Mon, 30 Aug 2010 17:03:03 -0400
Received: from c-69-245-226-104.hsd1.in.comcast.net ([69.245.226.104]
	helo=kosh.dhis.org) by debbugs.gnu.org with smtp (Exim 4.69)
	(envelope-from <pacman-cu@HIDDEN>) id 1OqBVN-0008P1-Er
	for 6949 <at> debbugs.gnu.org; Mon, 30 Aug 2010 17:03:01 -0400
Received: (qmail 28877 invoked by uid 1000); 30 Aug 2010 21:04:37 -0000
Message-ID: <20100830210437.28876.qmail@HIDDEN>
From: "Alan Curry" <pacman-cu@HIDDEN>
Subject: Re: bug#6949: Uniq command should allow total to be displayed
To: Miles.Duke@HIDDEN (Miles Duke)
Date: Mon, 30 Aug 2010 16:04:37 -0500 (GMT+5)
In-Reply-To: <42CFFC29FBA4FC48A39DBAFA5A2238D907E48FBA@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Spam-Score: 1.9 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
	has
	identified this incoming email as possible spam. The original message
	has been attached to this so you can view it (if it isn't spam) or
	label similar future email.  If you have any questions, see
	the administrator of that system for details.
	Content preview: Miles Duke writes: > > 'uniq --count' is an excellent
	tool for summarizing data,
	but it is > missing one useful feature - an overall
	total. This might be a good idea... > > It's embarrassing to have to go
	to excel to bring the totals together. [...] 
	Content analysis details:   (1.9 points, 10.0 required)
	pts rule name              description
	---- ----------------------
	--------------------------------------------------
	0.9 RCVD_IN_SORBS_DUL RBL: SORBS: sent directly from dynamic IP address
	[69.245.226.104 listed in dnsbl.sorbs.net]
	0.9 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
	[69.245.226.104 listed in zen.spamhaus.org]
	0.0 BAYES_50 BODY: Bayesian spam probability is 40 to 60%
	[score: 0.5000]
	0.1 RDNS_DYNAMIC           Delivered to trusted network by host with
	dynamic-looking rDNS
X-Debbugs-Envelope-To: 6949
Cc: 6949 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: 1.9 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has
	identified this incoming email as possible spam.  The original message
	has been attached to this so you can view it (if it isn't spam) or label
	similar future email.  If you have any questions, see
	the administrator of that system for details.
	Content preview:  Miles Duke writes: > > 'uniq --count' is an excellent tool
	for summarizing data, but it is > missing one useful feature - an overall
	total. This might be a good idea... > > It's embarrassing to have to go to
	excel to bring the totals together. [...] 
	Content analysis details:   (1.9 points, 10.0 required)
	pts rule name              description
	---- ---------------------- --------------------------------------------------
	0.9 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
	[69.245.226.104 listed in zen.spamhaus.org]
	0.9 RCVD_IN_SORBS_DUL      RBL: SORBS: sent directly from dynamic IP address
	[69.245.226.104 listed in dnsbl.sorbs.net]
	0.0 BAYES_50               BODY: Bayesian spam probability is 40 to 60%
	[score: 0.4610]
	0.1 RDNS_DYNAMIC           Delivered to trusted network by host with
	dynamic-looking rDNS
	-0.0 AWL                    AWL: From: address is in the auto white-list

Miles Duke writes:
> 
> 'uniq --count' is an excellent tool for summarizing data, but it is
> missing one useful feature - an overall total.

This might be a good idea...

> 
> It's embarrassing to have to go to excel to bring the totals together.

...but you can't think of any other tool that can add up a bunch of numbers?!
You're using dynamite to kill a mosquito. There must be a dozen basic
utilities that can do arithmetic. Like awk:

  ... | uniq -c | awk '{t+=$1}END{print t,"total"}1'

-- 
Alan Curry




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils@HIDDEN:
bug#6949; Package coreutils. Full text available.
Severity set to 'wishlist' from 'normal' Request was from Bob Proulx <bob@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 30 Aug 2010 15:42:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 30 11:42:57 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Oq6Vd-0004qw-20
	for submit <at> debbugs.gnu.org; Mon, 30 Aug 2010 11:42:57 -0400
Received: from mx10.gnu.org ([199.232.76.166])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <Miles.Duke@HIDDEN>) id 1Oq6Ak-0004jI-Vx
	for submit <at> debbugs.gnu.org; Mon, 30 Aug 2010 11:21:23 -0400
Received: from lists.gnu.org ([199.232.76.165]:39558)
	by monty-python.gnu.org with esmtps
	(TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60)
	(envelope-from <Miles.Duke@HIDDEN>) id 1Oq6CI-0004bq-If
	for submit <at> debbugs.gnu.org; Mon, 30 Aug 2010 11:22:58 -0400
Received: from [140.186.70.92] (port=52997 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Oq6CH-00016C-0P
	for bug-coreutils@HIDDEN; Mon, 30 Aug 2010 11:22:58 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,HTML_MESSAGE,
	RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <Miles.Duke@HIDDEN>) id 1Oq6CB-0001Ev-Ui
	for bug-coreutils@HIDDEN; Mon, 30 Aug 2010 11:22:56 -0400
Received: from exprod5og112.obsmtp.com ([64.18.0.24]:40237)
	by eggs.gnu.org with smtp (Exim 4.69)
	(envelope-from <Miles.Duke@HIDDEN>) id 1Oq6CB-0001EF-HJ
	for bug-coreutils@HIDDEN; Mon, 30 Aug 2010 11:22:51 -0400
Received: from source ([209.156.31.70]) by exprod5ob112.postini.com
	([64.18.4.12]) with SMTP
	ID DSNKTHvMyLX2hhoYRhhRwGDHnzaChRAn7WzQ@HIDDEN;
	Mon, 30 Aug 2010 08:22:51 PDT
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01CB4856.F937B530"
Subject: Uniq command should allow total to be displayed
Date: Mon, 30 Aug 2010 11:21:08 -0400
Message-ID: <42CFFC29FBA4FC48A39DBAFA5A2238D907E48FBA@HIDDEN>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Uniq command should allow total to be displayed
Thread-Index: ActIVviqH20H804/QJiG0wduen2RQQ==
From: "Miles Duke" <Miles.Duke@HIDDEN>
To: <bug-coreutils@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	4)
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6,
	seldom 2.4 (older, 4)
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Mon, 30 Aug 2010 11:42:54 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.3 (-----)

This is a multi-part message in MIME format.

------_=_NextPart_001_01CB4856.F937B530
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

This is not a bug, but a feature request.

=20

'uniq --count' is an excellent tool for summarizing data, but it is
missing one useful feature - an overall total.

=20

It's embarrassing to have to go to excel to bring the totals together.

=20

I suggest a new -t (--total) option:

=20

*         When combined with '--count', it reports the sum of the count
lines

*         Without the '--count', it reports the number of lines printed
by uniq

=20

As a new parameter, it will not break any scripts that rely upon the
current output of uniq.

=20

=20

Miles Duke (Miles.Duke@HIDDEN)

=20


------_=_NextPart_001_01CB4856.F937B530
Content-Type: text/html;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:x=3D"urn:schemas-microsoft-com:office:excel" =
xmlns:p=3D"urn:schemas-microsoft-com:office:powerpoint" =
xmlns:a=3D"urn:schemas-microsoft-com:office:access" =
xmlns:dt=3D"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" =
xmlns:s=3D"uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" =
xmlns:rs=3D"urn:schemas-microsoft-com:rowset" xmlns:z=3D"#RowsetSchema" =
xmlns:b=3D"urn:schemas-microsoft-com:office:publisher" =
xmlns:ss=3D"urn:schemas-microsoft-com:office:spreadsheet" =
xmlns:c=3D"urn:schemas-microsoft-com:office:component:spreadsheet" =
xmlns:odc=3D"urn:schemas-microsoft-com:office:odc" =
xmlns:oa=3D"urn:schemas-microsoft-com:office:activation" =
xmlns:html=3D"http://www.w3.org/TR/REC-html40" =
xmlns:q=3D"http://schemas.xmlsoap.org/soap/envelope/" =
xmlns:rtc=3D"http://microsoft.com/officenet/conferencing" =
xmlns:D=3D"DAV:" xmlns:Repl=3D"http://schemas.microsoft.com/repl/" =
xmlns:mt=3D"http://schemas.microsoft.com/sharepoint/soap/meetings/" =
xmlns:x2=3D"http://schemas.microsoft.com/office/excel/2003/xml" =
xmlns:ppda=3D"http://www.passport.com/NameSpace.xsd" =
xmlns:ois=3D"http://schemas.microsoft.com/sharepoint/soap/ois/" =
xmlns:dir=3D"http://schemas.microsoft.com/sharepoint/soap/directory/" =
xmlns:ds=3D"http://www.w3.org/2000/09/xmldsig#" =
xmlns:dsp=3D"http://schemas.microsoft.com/sharepoint/dsp" =
xmlns:udc=3D"http://schemas.microsoft.com/data/udc" =
xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" =
xmlns:sub=3D"http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/"=
 xmlns:ec=3D"http://www.w3.org/2001/04/xmlenc#" =
xmlns:sp=3D"http://schemas.microsoft.com/sharepoint/" =
xmlns:sps=3D"http://schemas.microsoft.com/sharepoint/soap/" =
xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" =
xmlns:udcs=3D"http://schemas.microsoft.com/data/udc/soap" =
xmlns:udcxf=3D"http://schemas.microsoft.com/data/udc/xmlfile" =
xmlns:udcp2p=3D"http://schemas.microsoft.com/data/udc/parttopart" =
xmlns:wf=3D"http://schemas.microsoft.com/sharepoint/soap/workflow/" =
xmlns:dsss=3D"http://schemas.microsoft.com/office/2006/digsig-setup" =
xmlns:dssi=3D"http://schemas.microsoft.com/office/2006/digsig" =
xmlns:mdssi=3D"http://schemas.openxmlformats.org/package/2006/digital-sig=
nature" =
xmlns:mver=3D"http://schemas.openxmlformats.org/markup-compatibility/2006=
" xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns:mrels=3D"http://schemas.openxmlformats.org/package/2006/relationshi=
ps" xmlns:spwp=3D"http://microsoft.com/sharepoint/webpartpages" =
xmlns:ex12t=3D"http://schemas.microsoft.com/exchange/services/2006/types"=
 =
xmlns:ex12m=3D"http://schemas.microsoft.com/exchange/services/2006/messag=
es" =
xmlns:pptsl=3D"http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/=
" =
xmlns:spsl=3D"http://microsoft.com/webservices/SharePointPortalServer/Pub=
lishedLinksService" xmlns:Z=3D"urn:schemas-microsoft-com:" =
xmlns:st=3D"&#1;" xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
	{mso-style-priority:34;
	margin-top:0in;
	margin-right:0in;
	margin-bottom:0in;
	margin-left:.5in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
	{page:Section1;}
 /* List Definitions */
 @list l0
	{mso-list-id:132411415;
	mso-list-type:hybrid;
	mso-list-template-ids:-1069781368 67698689 67698691 67698693 67698689 =
67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	margin-left:38.25pt;
	text-indent:-.25in;
	font-family:Symbol;}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext=3D"edit">
  <o:idmap v:ext=3D"edit" data=3D"1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal>This is not a bug, but a feature =
request.<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>&#8216;uniq --count&#8217; is an excellent tool for =
summarizing
data, but it is missing one useful feature &#8211; an overall =
total.<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>It&#8217;s embarrassing to have to go to excel to =
bring the
totals together.<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>I suggest a new -t (--total) option:<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoListParagraph =
style=3D'margin-left:38.25pt;text-indent:-.25in;
mso-list:l0 level1 lfo1'><![if !supportLists]><span =
style=3D'font-family:Symbol'><span
style=3D'mso-list:Ignore'>&middot;<span style=3D'font:7.0pt "Times New =
Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]>When combined with &#8216;--count&#8217;, =
it
reports the sum of the count lines<o:p></o:p></p>

<p class=3DMsoListParagraph =
style=3D'margin-left:38.25pt;text-indent:-.25in;
mso-list:l0 level1 lfo1'><![if !supportLists]><span =
style=3D'font-family:Symbol'><span
style=3D'mso-list:Ignore'>&middot;<span style=3D'font:7.0pt "Times New =
Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]>Without the &#8216;--count&#8217;, it =
reports
the number of lines printed by uniq<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>As a new parameter, it will not break any scripts =
that rely
upon the current output of uniq.<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>Miles Duke (Miles.Duke@HIDDEN)<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>

------_=_NextPart_001_01CB4856.F937B530--




Acknowledgement sent to "Miles Duke" <Miles.Duke@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-coreutils@HIDDEN. Full text available.
Report forwarded to owner <at> debbugs.gnu.org, bug-coreutils@HIDDEN:
bug#6949; Package coreutils. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.