From: kwzh@gnu.ai.mit.edu (Karl Heuer)
Date: Thu, 30 May 96 12:20:41 -0400
+ [Translated to POSIX 1003.1-2001 terminology by Paul Eggert.]
[...]I believe I've found another bug in `sort'.
$ cat /tmp/sort.in
a b c 2 d
pq rs 1 t
- $ textutils-1.15/src/sort +0.6 -0.7 </tmp/sort.in
+ $ textutils-1.15/src/sort -k1.7,1.7 </tmp/sort.in
a b c 2 d
pq rs 1 t
- $ /bin/sort +0.6 -0.7 </tmp/sort.in
+ $ /bin/sort -k1.7,1.7 </tmp/sort.in
pq rs 1 t
a b c 2 d
Unix sort produced the answer I expected: sort on the single character
- in column 6. GNU sort produced different results, because it disagrees
- on the interpretation of the key-end spec "-M.N". Unix sort reads this
- as "skip M fields, then N characters"; but GNU sort wants it to mean
- "skip M fields, then either N characters or the rest of the current
+ in column 7. GNU sort produced different results, because it disagrees
+ on the interpretation of the key-end spec "M.N". Unix sort reads this
+ as "skip M-1 fields, then N-1 characters"; but GNU sort wants it to mean
+ "skip M-1 fields, then either N-1 characters or the rest of the current
field, whichever comes first". This extra clause applies only to
key-ends, not key-starts.
*/
}
/* To start printing with item N_UNITS from the start of the file, skip
- N_UNITS - 1 items. `tail +0' is actually meaningless, but for Unix
- compatibility it's treated the same as `tail +1'. */
+ N_UNITS - 1 items. `tail -n +0' is actually meaningless, but for Unix
+ compatibility it's treated the same as `tail -n +1'. */
if (from_start)
{
if (n_units)