bug-coreutils
[Top][All Lists]
Advanced

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

Re: bug report - uniq


From: Eric Blake
Subject: Re: bug report - uniq
Date: Mon, 17 Dec 2007 06:15:00 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Jiusheng Chen on 12/16/2007 11:13 PM:
> Hello,
> 
> Can someone explain why the following happens?
> 
> address@hidden:~/DE_COUNT/loser_percentage_analysis/mysql_outputs$ uniq 
> test_uniq
> 106996516444209225
> 1
> 106996516444209225
> 1

Not a bug.  Reread 'uniq --help', in particular, the bit about:

| Discard all but one of successive identical lines from INPUT (or
| standard input), writing to OUTPUT (or standard output).

If your file is not sorted beforehand, then uniq is not going to sort it
either.  You may be interested in 'sort -u'.

As an aside, I'm wondering if the --help output for uniq should be a bit
more explicit about this property; contrast it with the output for join,
which states:
|Important: FILE1 and FILE2 must be sorted on the join fields.
|E.g., use `sort -k 1b,1' if `join' has no options.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHZnZU84KuGfSFAYARAg/PAJ9ME09aRgfnvgPNCQWzInO1FbnbmQCfU5N6
LrVJB0ZRFpTR4GMFTTVJAYM=
=R3M/
-----END PGP SIGNATURE-----




reply via email to

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