I am trying to sort this file based on the fourth column. I want the file to reordered based on the values of the fourth column.
File:
2 1:103496792:A 0 103496792
3 1:103544434:A 0 103544434
4 1:103548497:A 0 103548497
1 1:10363487:T 0 10363487
I want it sorted like this:
1 1:10363487:T 0 10363487
2 1:103496792:A 0 103496792
3 1:103544434:A 0 103544434
4 1:103548497:A 0 103548497
I tried this command:
sort -t$'\t' -k1,1 -k2,2 -k3,3 -k 4,4 <filename>
But I get illegal variable name error. Can somebody help me with this?