bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FW: Uniq command gives wrong and different results


From: Bob Proulx
Subject: Re: FW: Uniq command gives wrong and different results
Date: Thu, 12 Oct 2006 08:50:09 -0600
User-agent: Mutt/1.5.9i

Fong Tin Joen, Raimund wrote:
> You are right about one thing and that is about using the sort command
> first.
> 
> Due to excitement or perhaps confusion I forgot to mention that I did
> used the sort command as given in your example.
> ...
> All I meant to say is :
> That with the usage of the sort command or a sorted file as an input for
> the uniq command, the outcome is awkward.
> The results are given in the mail I've sent earlier.

Awkward?  Unfortunately while that depicts an emotional result it is
inexact for describing what the system is doing.  Please be more
specific.  Examples are best.

  printf "a\na\nb\nb\nc\n" | uniq -u
  c
  printf "a\na\nb\nb\nc\n" | uniq -d
  a
  b
  printf "a\na\nb\nb\nc\n" | uniq -u
  c

> I know that instead of the "uniq -u" the "sort -u" works fine, but for
> "uniq -d" there is no alternative.

What problems are you having with the following?

  sort Foo | uniq -d

Can you provide a small example?

> The purpose of this mail is to mention the strange behaviour I received
> form the uniq command, especially when used several times in a row on
> this Foo file.
> 
> Please let me know if you receive correct results for uniq after sorted
> the Foo file I delivered.
> This than can only mean that to resolve this issue I need to look
> further or perhaps you can inform me how I can resolve it.

Yes.  I get a correct result on the sorted file.

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]