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
>
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
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
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
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
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
>
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
1 2
1 3
1 6
1 7
1 8
1
/tmp »
As you can see it does not eliminate dup
7 matches
Mail list logo