Subject: bug#6529: closed (Re: bug#6442: About the modifier of -k option in sort)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 29 Jun 2010 00:25:02 +0000

Your bug report

#6442: --key option problem

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
6442: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6442
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#6442: About the modifier of -k option in sort
From: Pádraig Brady <[email-masked]>
To: [email-masked]
Date: Tue, 29 Jun 2010 01:24:47 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

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 (_("\

Subject: --key option problem
From: Victor Grishchenko <[email-masked]>
To: [email-masked]
Date: Mon, 28 Jun 2010 16:26:51 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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