From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110822 invoked by alias); 11 Oct 2016 14:33:56 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 110806 invoked by uid 89); 11 Oct 2016 14:33:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Repin, repin, thompson!, H*f:sk:f5bd1j7 X-HELO: loire.is.ed.ac.uk Received: from loire.is.ed.ac.uk (HELO loire.is.ed.ac.uk) (129.215.16.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 11 Oct 2016 14:33:44 +0000 Received: from crunchie.inf.ed.ac.uk (crunchie.inf.ed.ac.uk [129.215.33.180]) by loire.is.ed.ac.uk (8.14.7/8.14.6) with ESMTP id u9BEXg4U006981 for ; Tue, 11 Oct 2016 15:33:42 +0100 Received: from troutbeck.inf.ed.ac.uk (troutbeck.inf.ed.ac.uk [129.215.25.32]) by crunchie.inf.ed.ac.uk (8.14.4/8.14.4) with ESMTP id u9BEXg9P017668 for ; Tue, 11 Oct 2016 15:33:42 +0100 Received: from troutbeck.inf.ed.ac.uk (localhost [127.0.0.1]) by troutbeck.inf.ed.ac.uk (8.14.7/8.14.7) with ESMTP id u9BEXfLA012840 for ; Tue, 11 Oct 2016 15:33:41 +0100 Received: (from ht@localhost) by troutbeck.inf.ed.ac.uk (8.14.7/8.14.7/Submit) id u9BEXfKY012839; Tue, 11 Oct 2016 15:33:41 +0100 To: cygwin@cygwin.com Subject: Re: uniq not working References: <1476955236.20161011171902@yandex.ru> From: ht@inf.ed.ac.uk (Henry S. Thompson) Date: Tue, 11 Oct 2016 16:02:00 -0000 In-Reply-To: <1476955236.20161011171902@yandex.ru> (Andrey Repin's message of "Tue\, 11 Oct 2016 17\:19\:02 +0300") Message-ID: User-Agent: Gnus/5.1012 (Gnus v5.10.12) XEmacs/21.5-b34 (linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Edinburgh-Scanned: at loire.is.ed.ac.uk with MIMEDefang 2.78, Sophie, Sophos Anti-Virus, Clam AntiVirus X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg00159.txt.bz2 Andrey Repin writes: > Greetings, Henry S. Thompson! > >> You may find the following bash function useful: > >> sus () >> { >> sort "$@" | uniq -c | sort -k1nr,1 >> } > > Why not sort -u ? Because then all the counts will be 1. ht -- Henry S. Thompson, School of Informatics, University of Edinburgh 10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440 Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk URL: http://www.ltg.ed.ac.uk/~ht/ [mail from me _always_ has a .sig like this -- mail without it is forged spam] -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple