'sort -k 1' is the same as 'sort'. Indeed, giving one single integer N (here 1) to option -k means "*from* the Nth column to the last one". Here is the relevant excerpt from 'info sort':

‘-k POS1[,POS2]’
‘--key=POS1[,POS2]’
     Specify a sort field that consists of the part of the line between
     POS1 and POS2 (or the end of the line, if POS2 is omitted),
     _inclusive_.

It is the root of your problem here. The join fields of ListB-w.txt and ListA-w-Counts.txt are not sorted in the same way because of that. They have to for 'join' to properly work.

Also simplifying the sequence of commands (with apparently useless steps and options), you get: $ join -2 2

Reply via email to