I have a file ( 3 columns tab delimited), I need to check if file is sorted or not Example:
chr1 9999999 10000125 C57T3ANXX:7:2114:14205:58915/2 50 -
chr1 10010918 10011044 C57T3ANXX:7:2310:08814:31632/1 50 +
chr1 10011185 10011311 C57T3ANXX:7:2310:08814:31632/2 50 -
On above file, I use
cut -f1,2 f |sort -cn,
which give me
sort: -:2: disorder: chr1 10010918.
I am not sure why, as the file is already sorted. I get same order when I use
sort -k1,1 -k2,2 f