On 5/1/06, Robert Citek <[EMAIL PROTECTED]> wrote:
> Is this a bug in 'sort'?

No.

> So, to get 'sort' to work in multiple-column data, I had to use one
> of two workarounds: 1) adjust the character offset or 2) explicitly
> specify the delimiter.   Would this be considered a bug?  Or am I
> overlooking some setting?  Can anyone else replicate my results?

Quoting from the sort info manual (info coreutils sort):

`-t SEPARATOR'
`--field-separator=SEPARATOR'
     Use character SEPARATOR as the field separator when finding the
     sort keys in each line.  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'.  The field separator is not considered
     to be part of either the field preceding or the field following.
     But note that sort fields that extend to the end of the line, as
     `-k 2', or sort fields consisting of a range, as `-k 2,3', retain
     the field separators present between the endpoints of the range.

     To specify a zero byte (ASCII NUL (Null) character) as the field
     separator, use the two-character string `\0', e.g., `sort -t '\0''.

So, using the default separator, the tab character is the first
character in the second field (which is why 2.5 works).

--
David Dooling
 
_______________________________________________
CWE-LUG mailing list
[email protected]
http://www.cwelug.org/
http://www.cwelug.org/archives/
http://www.cwelug.org/mailinglist/

Reply via email to