From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510 Description of problem: When sorting on two keys, the "n" (numeric) flag on the second key is not honoured. Version-Release number of selected component (if applicable): coreutils-5.2.1-7 How reproducible: Always Steps to Reproduce: 1.data="b 0 b 88 a 0 a 17454 a 2338" 2. echo "$data" | sort -k1,1 -k2bn,2 3. Actual Results: a 0 a 17454 a 2338 b 0 b 88 Expected Results: a 0 a 2338 a 17454 b 0 b 88 Additional info: I have tried various other, equivalent, syntaxes for specifying the keys, and various input data. The bug is consistently reproducible. Note that echo "$data" | sort -k2bn,2 does sort numerically, as expected.
The following work-round works: echo "$data" | LC_ALL=C sort -k4,4 -k5bn,5 Thanks to http://www.tinyvital.com/techblog/archives/000332.html (for info, env | grep LC returned nothing in my environment.)
This was a bug in the i18n patch. Fixed in 5.2.1-18. Thanks for the report.