bug-coreutils
[Top][All Lists]
Advanced

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

Re: different behavior of sort


From: Andreas Schwab
Subject: Re: different behavior of sort
Date: Tue, 19 Jan 2010 17:23:17 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux)

Sheila Yao <address@hidden> writes:

> sort -n -k2.1,2.4 /tmp/sort.out
> /dev/emcpowera         47G   39G  7.8G  84% /DB1/DW/data9
                ^^^^
The sort key is probably not what you think it is.   I have marked it
for you.  Since the sort key is identical in all lines, sort has used
as a last resort the whole line as the sort key.

>From sort --help:

    POS is F[.C][OPTS], where F is the field number and C the character position
    in the field; both are origin 1.  If neither -t nor -b is in effect, 
characters
    in a field are counted from the beginning of the preceding whitespace.

You should probably just use the whole second field as the sort key.

Andreas.

-- 
Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

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