delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/10/11/10:20:41

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:date:from:reply-to:message-id:to:subject
:in-reply-to:references:mime-version:content-type
:content-transfer-encoding; q=dns; s=default; b=g4p1dsQk6sWqncJL
OKk5fUPgSaqOKTBrpylp0IJTfDbCK55dtcn+UPjViYYWKUShrGoR7zezo4+evISz
EJbmuTtlpmqD+RAP/Yo2etQtRiSuorEHxpQEWYBP69gWUJ89UdQDtyQjaxAINpfs
7W3q8sc/hAJA+UL3+4R+C7csuM4=
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:date:from:reply-to:message-id:to:subject
:in-reply-to:references:mime-version:content-type
:content-transfer-encoding; s=default; bh=tf0UHeaX1XycEx3dyY78du
XG7fI=; b=uQeBauDAD4rtXbE5FwBNPJqyXQUKs3Qf4Dqkbq//nqQqB3qlxaRJla
Ntb0jEICiEkGFjY4xvsJWOgOhnvk4CcBt8t/BOs2Jo8K+P9rz58lefpMpaSZ3Ghs
62JZVdMPYpWtNwOFW94w5ySvexVAYCok//u07d2nWFxWgXiE+Gca4=
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=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
Authentication-Results: smtp3m.mail.yandex.net; dkim=pass header.i=@yandex.ru
X-Yandex-Suid-Status: 1 0,1 0
Date: Tue, 11 Oct 2016 17:19:02 +0300
From: Andrey Repin <anrdaemon AT yandex DOT ru>
Reply-To: cygwin AT cygwin DOT com
Message-ID: <1476955236.20161011171902@yandex.ru>
To: ht AT inf DOT ed DOT ac DOT uk (Henry S. Thompson), cygwin AT cygwin DOT com
Subject: Re: uniq not working
In-Reply-To: <f5bd1j7yrjl.fsf@troutbeck.inf.ed.ac.uk>
References: <CAMZ6u3uuA8Jvz5pKtcrmb6M01WfEFVBduCPv23iu1FgKb=C+UQ AT mail DOT gmail DOT com> <CAEhDDbCrMOUsOfD0FVxfBXUE1TQAqsnmCM4=03dscgSFud35fg AT mail DOT gmail DOT com> <f5bd1j7yrjl DOT fsf AT troutbeck DOT inf DOT ed DOT ac DOT uk>
MIME-Version: 1.0
X-IsSubscribed: yes

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

- Raw text -


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