>From the uniq manpage: Note: 'uniq' does not detect repeated lines unless they are adjacent. You may want to sort the input first, or use 'sort -u' without 'uniq'. Also, comparisons honor the rules specified by 'LC_COLLATE'.
On Mon, Aug 16, 2021 at 10:45 PM wes <[email protected]> wrote: > > On Mon, Aug 16, 2021 at 8:45 PM Randy Bush <[email protected]> wrote: > > > > > can you point me to where it is documented that `find` is guaranteed > > to produce an ordered list? > > > > I don't have any such documentation or belief. my belief is that uniq will > count non-consecutive matches, that's what I'm relying on. however, sorting > first doesn't hurt anything, so have at it. > > yeah, awk is often a more appropriate tool for this type of job, it's just > that I happened to learn sed first, so I default to that. it's the same > reason I use vi instead of emacs, it's largely down to complete coincidence. > > -wes
