Re: uniq not working

2016-10-13 Thread Felipe Vieira
On Tue, Oct 11, 2016 at 7:43 AM, Felipe Vieira wrote: > Dear mailing list, > > the uniq program seems to be faulty on my cygwin: > > /tmp » cat u.txt > 1 > 2 > 3 > 4 > 5 > 1 > 2 > 3 > 6 > 7 > 8 > > > /tmp » uniq -c u.txt > 1 1 > 1 2 > 1 3 > 1 4 > 1 5 > 1 1 >

Re: uniq not working

2016-10-11 Thread Henry S. Thompson
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, Univer

Re: uniq not working

2016-10-11 Thread Andrey Repin
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

Re: uniq not working

2016-10-11 Thread Henry S. Thompson
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

Re: uniq not working

2016-10-11 Thread Markus Schönhaber
Am 11.10.2016 um 12:43 schrieb Felipe Vieira: > the uniq program seems to be faulty on my cygwin: > [...] > /tmp » uniq -c u.txt > 1 1 > 1 2 > 1 3 > 1 4 > 1 5 > 1 1 > 1 2 > 1 3 > 1 6 > 1 7 > 1 8 > 1 > /tmp » > > As you can s

Re: uniq not working

2016-10-11 Thread Csaba Raduly
Hi Felipe, On Tue, Oct 11, 2016 at 12:43 PM, Felipe Vieira wrote: > Dear mailing list, > > the uniq program seems to be faulty on my cygwin: > > /tmp » cat u.txt > 1 > 2 > 3 > 4 > 5 > 1 > 2 > 3 > 6 > 7 > 8 > > > /tmp » uniq -c u.txt > 1 1 > 1 2 > 1 3 > 1 4 > 1 5 >