--- Begin Message ---
Subject: |
--key option problem |
Date: |
Mon, 28 Jun 2010 16:26:51 +0200 |
Hi!
Today I've ran into a problem of the sort ignoring the --key parameter.
It sorts data according to the alphanumeric order of the full string instead.
Twiddling here and there (coreutils version, LC_ALL, positions, etc) did not
work.
Any ideas?
harvest$ zcat data.log.gz | pcregrep '[TR]data' | head -10 | sort --key=17,30
0_01_18_139_840 vtt1_100 vtt2_9#8 Tdata (0,8132)
0_01_19_377_086 vtt1_100 vtt2_9#8 Tdata (0,8132)
0_01_19_771_887 vtt1_100 vtt1_6#2 Tdata (0,7832)
0_01_19_794_385 vtt1_100 vtt1_2#3 Tdata (0,7832)
0_01_20_456_841 vtt1_100 vtt1_23#4 Tdata (0,8132)
0_01_21_444_514 vtt1_100 vtt2_6#7 Tdata (0,8132)
0_01_21_444_752 vtt1_100 vtt1_26#5 Tdata (0,7832)
0_01_22_944_496 vtt1_100 vtt2_8#9 Tdata (0,7835)
0_01_23_498_353 vtt1_100 vtt2_26#10 Tdata (0,7835)
0_01_23_612_298 vtt1_100 vtt1_4#6 Tdata (0,7832)
harvest$ sort --version
sort (GNU coreutils) 8.5
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Mike Haertel and Paul Eggert.
harvest$ env
TERM=xterm-color
SHELL=/bin/bash
SSH_TTY=/dev/pts/32
LC_ALL=C
PATH=/home/victor/bin:/usr/local/bin:/usr/bin:/bin:/usr/games
LANG=en_US.UTF-8
PS1=\W\$
SHLVL=1
_=/home/victor/bin/env
harvest$
--
V
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#6442: About the modifier of -k option in sort |
Date: |
Tue, 29 Jun 2010 01:24:47 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 |
I've applied this doc tweak:
On 17/06/10 09:30, Pádraig Brady wrote:
> --- a/src/sort.c
> +++ b/src/sort.c
> @@ -386,7 +386,7 @@ Other options:\n\
> "), stdout);
> fputs (_("\
> -k, --key=POS1[,POS2] start a key at POS1 (origin 1), end it at POS2\n\
> - (default end of line)\n\
> + (default end of line). See POS syntax below\n\
> -m, --merge merge already sorted files; do not sort\n\
> "), stdout);
> fputs (_("\
--- End Message ---