Steve Ward <plane...@gmail.com> writes: > On Tue, Dec 15, 2009 at 20:18, john blair > <mailtome200420032...@yahoo.com>wrote: > >> cat a | /build/toolchain/lin32/coreutils-8.2/bin/sort -V >> kernel-2.6.18-164.2.1.el5.x86_64.rpm >> kernel-2.6.18-164.6.1.el5.x86_64.rpm >> kernel-2.6.18-164.el5.x86_64.rpm >> >> The result should be >> kernel-2.6.18-164.el5.x86_64.rpm >> kernel-2.6.18-164.2.1.el5.x86_64.rpm >> kernel-2.6.18-164.6.1.el5.x86_64.rpm >> >> Is it a bug is sort -V? >> >> >> >> >> >> >> >> > What version of sort are you using? > (sort --version) > > What is your locale setting? > > In ASCII, decimal digits are before alphabetical letters. Why did you > expect the 'e' to come before '2' and '6'?
The version compare rules specify that numeric and non-numeric parts are compared independently from left to right, and an empty part sorts before any non-empty part (except tilde in a non-numeric part), thus "kernel-2.6.18-164." sorts before "kernel-2.6.18-164.2". Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."