bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in sort?? using the C character offset in the second column...


From: Philip Rowlands
Subject: Re: Bug in sort?? using the C character offset in the second column...
Date: Thu, 14 Apr 2005 17:49:09 +0100 (BST)

On Thu, 14 Apr 2005, Neville address@hidden wrote:

>$ echo "= =Apr,= =Mar,= =May" | tr "," "\012" | sort -k 2.2,2.5M
>= =Apr
>= =Mar
>= =May

The field does not start where you think; quoting 'info sort':

> By default, fields are separated by the empty string between a
> non-blank character and a blank character. That is, given the input
> line ` foo bar', `sort' breaks it into fields ` foo' and ` bar'.

This works:
$ echo "= =Apr,= =Mar,= =May" | tr "," "\012" | sort -k 2.3,2.5M
= =Mar
= =Apr
= =May


Cheers,
Phil




reply via email to

[Prev in Thread] Current Thread [Next in Thread]