0

this is the content of test file:

this this  
this that  
is that  
a that  
MAP that  
map that  

when I do uniq testCase -f1, the result is:

this this  
this that  

which is reasonable, but if I run: testCase -f2, I get:

this this 

why is this happening? and can someone tell me what is the default delimiter of -f, it is not in man.

2

1 Answer 1

5

From man uniq:

A field is a run of blanks (usually spaces and/or TABs), then non-blank characters. Fields are skipped before chars.

With -f2 you're skipping all your fields, so only the first line gets output, all the others are equal after the second field (none have more than two).

1
  • 1
    should be accepted.
    – sehe
    Apr 24, 2011 at 16:57

You must log in to answer this question.