On 12/12/2010 1:00 PM, Brett Parker wrote:
> On 12 Dec 11:16, Marc Perkel wrote:
>> Thanks in advance for answering my off topic question.
>>
>> Looking for a simple way to use sort | uniq in a way that returns only
>> those lines that are duplicate more and say 3 times. A file like:
>>
>> one
>> two
>> two
>> three
>> three
>> three
>> four
>> four
>> four
>> four
>>
>> would return
>>
>> three
>> four
> in bash:
>
> $ cat test.txt | sort | uniq -c | while read line; do count=${line% *}; if
> [ $count -ge 3 ]; then echo ${line/*$count /}; fi; done
> four
> three
> $
>
> Cheers,

Thanks but I'm getting "too many arguments" on

[ $count -ge 3 ];




-- 
## List details at http://lists.exim.org/mailman/listinfo/exim-users 
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

Reply via email to