-----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? > > [EMAIL PROTECTED]:~/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 [EMAIL PROTECTED] -----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----- _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils