in reply to Re: Re: Removing repeated lines from file
in thread Removing repeated lines from file
uniq works on sorted files only. The man page suggests that it does remowe consecutive duplicates, but the first sentence states that it removes repeating lines from sorted files.
Then either your man page lies, or your vendor uses a uniq implementation that's not confirming to the POSIX standard.
From the POSIX 1003.1 standard:
DESCRIPTIONThe uniq utility shall read an input file comparing adjacent lines, and write one copy of each input line on the output. The second and succeeding copies of repeated adjacent input lines shall not be written.Repeated lines in the input shall not be detected if they are not adjacent.
Abigail
|
|---|