I have a list of IDs (sorted) in two files and I ran the comm command to compare them, but it seems to miss out one lines common to both files. Why is that?
File1:
1
2
3
4
5
6
7
8
9
11
12
13
15
16
17
18
19
20
21
22
File2:
16
18
21
23
705
707
709
711
712
826
827
839
846
847
848
872
873
874
875
891
Comm output: $> comm file1 file1
1
16 //exists in both files
18 //exists in both files
2
21
23
3
4
5
6
7
705
707
709
711
712
8
826
827
839
846
847
848
872
873
874
875
891
9
11
12
13
15
16 //it's here!
17
18 //...and here!
19
20
21
22
The files are both sorted. However, my guess is that comm doesn't do numeric comparison and only looks at entries lexicographically? If so, what are some alternatives that I can try for this?