delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/10/11/08:55:10

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:subject:references:from:date:in-reply-to
:message-id:mime-version:content-type; q=dns; s=default; b=kpa2D
79hfD2RzYu7MmGaBnz1Ger2cp8Y8ViBMBCTVqezOqzPzJltVYRGMP6hlL0ph5m5H
Vt8V2NG+oA6f2Xr0bi1QoGNivGBR8jwiwIKFiKWxT0/F7pmkrVMAERJkAqjHH60y
wsjuTYFA8RPU/eg4lUo3CNhaX5wSgHLlebyjPg=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:subject:references:from:date:in-reply-to
:message-id:mime-version:content-type; s=default; bh=CYl0ZxG0bMP
KpJ2SkQEp+44++xI=; b=YDt1w311F6jOW90lR1Ee6yqas4aq5qTAQnpGFcfCUON
5GgpFyIE+wPNcFoEGDfu5BcIYG2OF9FSbdNdeUa3S+1g1GMM7UmwniaSS2L/1SHQ
IqrU7ch+f7FcJk401JccgKS94B+eBWfQWPDSU71/bNxS98klv87CJgjqygC5hYMo
=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=0.2 required=5.0 tests=AWL,BAYES_50,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=H*F:D*ac.uk, School, forged, henry
X-HELO: loire.is.ed.ac.uk
To: cygwin AT cygwin DOT com
Subject: Re: uniq not working
References: <CAMZ6u3uuA8Jvz5pKtcrmb6M01WfEFVBduCPv23iu1FgKb=C+UQ AT mail DOT gmail DOT com> <CAEhDDbCrMOUsOfD0FVxfBXUE1TQAqsnmCM4=03dscgSFud35fg AT mail DOT gmail DOT com>
From: ht AT inf DOT ed DOT ac DOT uk (Henry S. Thompson)
Date: Tue, 11 Oct 2016 13:54:38 +0100
In-Reply-To: <CAEhDDbCrMOUsOfD0FVxfBXUE1TQAqsnmCM4=03dscgSFud35fg@mail.gmail.com> (Csaba Raduly's message of "Tue\, 11 Oct 2016 12\:56\:54 +0200")
Message-ID: <f5bd1j7yrjl.fsf@troutbeck.inf.ed.ac.uk>
User-Agent: Gnus/5.1012 (Gnus v5.10.12) XEmacs/21.5-b34 (linux)
MIME-Version: 1.0
X-Edinburgh-Scanned: at loire.is.ed.ac.uk with MIMEDefang 2.78, Sophie, Sophos Anti-Virus, Clam AntiVirus
X-IsSubscribed: yes

You may find the following bash function useful:

sus () 
{ 
    sort "$@" | uniq -c | sort -k1nr,1
}

With you data:

> sus u.txt

      2 1
      2 2
      2 3
      1 4
      1 5
      1 6
      1 7
      1 8

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 AT inf DOT ed DOT ac DOT 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019