Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2
On 02/06/13 02:49, Knud Arnbjerg Christensen wrote:
> linux-sort inconsistency occours when sorting an alfpha-numeric field,
> then the order becomes different depending on if the following field is
> numeric (file 1) or alfanumeric (file 2). In case one the length of the
> shorter fields is extended by ´zeros´ in case 2 the fields is extended by
> blanks which cause the different sorting order.
>
> knud c
>
> sort -k 1 file1>file1-sorted
It looks to me like 'sort' is behaving as documented.
'-k 1' means "use the concatenation of all the fields, starting
with field 1, as the key". It does not mean "use
just field 1 as the key". The documentation explains
this in some detail.