GNU bug report logs -
#6442
About the modifier of -k option in sort
Previous Next
Reported by: Peng Yu <pengyu.ut <at> gmail.com>
Date: Thu, 17 Jun 2010 02:08:01 UTC
Severity: normal
Merged with 6529
Done: Pádraig Brady <P <at> draigBrady.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Tue, 29 Jun 2010 01:24:47 +0100
with message-id <4C293D4F.5070605 <at> draigBrady.com>
and subject line Re: bug#6442: About the modifier of -k option in sort
has caused the GNU bug report #6442,
regarding --key option problem
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
6442: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6442
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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
[Message part 3 (message/rfc822, inline)]
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 (_("\
This bug report was last modified 14 years and 337 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.