Fong Tin Joen, Raimund wrote: > When using the uniq command on the delivered file the result is not > as expected. It als gives random results depending on using it > several times after eachother.
Your file is not sorted. Sort the file first. The sort documentation says: By default, `uniq' prints its input lines, except that it discards all but the first of adjacent repeated lines, so that no output lines are repeated. Optionally, it can instead discard lines that are not repeated, or all repeated lines. The input need not be sorted, but repeated input lines are detected only if they are adjacent. If you want to discard non-adjacent duplicate lines, perhaps you want to use `sort -u'. Because the file is not sorted the duplicated lines are not adjacent and fail the adjacency requirement. Try this: sort Foo | uniq -u That will show that there are no unique lines in the file. Bob _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils