This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: uniq not working
- From: ht at inf dot ed dot ac dot uk (Henry S. Thompson)
- To: cygwin at cygwin dot com
- Date: Tue, 11 Oct 2016 13:54:38 +0100
- Subject: Re: uniq not working
- Authentication-results: sourceware.org; auth=none
- References: <CAMZ6u3uuA8Jvz5pKtcrmb6M01WfEFVBduCPv23iu1FgKb=C+UQ@mail.gmail.com> <CAEhDDbCrMOUsOfD0FVxfBXUE1TQAqsnmCM4=03dscgSFud35fg@mail.gmail.com>
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@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