From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68369 invoked by alias); 11 Oct 2016 14:20:17 -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 67752 invoked by uid 89); 11 Oct 2016 14:20:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.3 required=5.0 tests=AWL,BAYES_20,FREEMAIL_FROM,KAM_THEBAT,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 spammy=H*M:yandex, H*MI:sk:03dscgS, H*MI:sk:CAEhDDb, HTo:D*ed.ac.uk X-HELO: forward3h.cmail.yandex.net Received: from forward3h.cmail.yandex.net (HELO forward3h.cmail.yandex.net) (87.250.230.18) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 11 Oct 2016 14:20:06 +0000 Received: from smtp3m.mail.yandex.net (smtp3m.mail.yandex.net [77.88.61.130]) by forward3h.cmail.yandex.net (Yandex) with ESMTP id 4F38220EE4; Tue, 11 Oct 2016 17:20:04 +0300 (MSK) Received: from smtp3m.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp3m.mail.yandex.net (Yandex) with ESMTP id 6FC982840493; Tue, 11 Oct 2016 17:20:02 +0300 (MSK) Received: by smtp3m.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 3Vcn0bHqXW-K2BCWvml; Tue, 11 Oct 2016 17:20:02 +0300 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client certificate not present) Authentication-Results: smtp3m.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-Suid-Status: 1 0,1 0 Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Tue, 11 Oct 2016 14:19:02 -0000 Date: Tue, 11 Oct 2016 14:33:00 -0000 From: Andrey Repin Reply-To: cygwin@cygwin.com Message-ID: <1476955236.20161011171902@yandex.ru> To: ht@inf.ed.ac.uk (Henry S. Thompson), cygwin@cygwin.com Subject: Re: uniq not working In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg00158.txt.bz2 Greetings, Henry S. Thompson! > You may find the following bash function useful: > sus () > { > sort "$@" | uniq -c | sort -k1nr,1 > } Why not sort -u ? > With you data: >> sus u.txt > 2 1 > 2 2 > 2 3 > 1 4 > 1 5 > 1 6 > 1 7 > 1 8 > ht -- With best regards, Andrey Repin Tuesday, October 11, 2016 17:18:39 Sorry for my terrible english... -- 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