[Top][All Lists]

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

sort 2.0; off by one in -k char position

From: Scott Schwartz
Subject: sort 2.0; off by one in -k char position
Date: 13 Jun 2002 01:03:31 -0400
Date: Thu, 13 Jun 2002 01:03:31 -0400

$ sort --version
sort (GNU textutils) 2.0

As seen using the enclosed test data, gnu sort appears to misinterpret
the character position component of the -k flag.  Sun's sort program
works as expected, and gnu sort behaves the same way if the offsets
are decremented.

sun sort, correct: sort -f -k 2n -k 2.6M,2.8
gnu sort, wrong:   sort -f -k 2n -k 2.6M,2.8
gnu sort, oops:    sort -f -k 2n -k 2.7M,2.9

Sample input,
 192 2000-September.txt.bz2
  80 2000-October.txt.bz2
 152 2000-November.txt.bz2
  88 2000-December.txt.bz2
 428 2001-January.txt.bz2
 156 2001-February.txt.bz2
 104 2001-March.txt.bz2
 260 2001-April.txt.bz2
 192 2001-May.txt.bz2
 172 2001-June.txt.bz2
 136 2001-July.txt.bz2
 168 2001-August.txt.bz2
1016 2001-September.txt.bz2
 216 2001-October.txt.bz2
 252 2001-November.txt.bz2
 108 2001-December.txt.bz2
 128 2002-January.txt.bz2
 208 2002-February.txt.bz2
 192 2002-March.txt.bz2
 292 2002-April.txt.bz2
 384 2002-May.txt.bz2
 240 2002-June.txt

reply via email to

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