osx - `uniq` not working as expected -



osx - `uniq` not working as expected -

i have file called "test.txt" looks this:

10 10 10 8 10 9 10 10 9 10 8

for reason, when ran uniq test.txt, got output:

10 8 10 9 10 9 10 8

why getting output? using bsd uniq. there sort of bug in program?

i'm not expert, i'm pretty sure uniq compares adjacent lines. don't have utilize running man uniq on scheme get:

the uniq utility reads specified input_file comparing adjacent lines, , writes re-create of each unique input line output_file. if input_file single dash (`-') or absent, standard input read. if output_file absent, standard output used output. sec , succeeding copies of identical adjacent input lines not written. repeated lines in input not detected if not adja- cent, may necessary sort files first.

so have adjacent detected. hence, repeated reports. they're different adjacent lines, , that's uniq tests for.

hope helps. lemme know if missed anything, i'm sort of curious, too.

osx bsd uniq

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -