I used comm to compare two sorted files. Each line in these files are positive integer numbers. But the results show

comm: file 1 is not in sorted order
comm: file 2 is not in sorted order

How come the error even if these two files are sorted?


comm wants lexicographic sort, not numeric sort. Correct this and the problem should go away.

  • how to make it do numeric sort? – wenzi Nov 16 '12 at 11:32
  • 4
    @wenzi sort -n – Gilles Nov 16 '12 at 22:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.