i cant figure out if i'm doing something stupid here or sort is doing 
something wrong ...

consider this (reduced) input:
/path/._cfg0000_asciidoc.conf%/path/%._cfg0000_%asciidoc.conf
/path/._cfg0000_docbook.conf%/path/%._cfg0000_%docbook.conf
/path/._cfg0001_asciidoc.conf%/path/%._cfg0001_%asciidoc.conf

i want to have the files sorted by (1) path then (2) file name then (3) cfg 
order.  so i use this:
sort -t% -k2 -k4 -k3

but i keep getting the same output as my input:
$ cat f | sort -t% -k2 -k4 -k3
/path/._cfg0000_asciidoc.conf%/path/%._cfg0000_%asciidoc.conf
/path/._cfg0000_docbook.conf%/path/%._cfg0000_%docbook.conf
/path/._cfg0001_asciidoc.conf%/path/%._cfg0001_%asciidoc.conf

even if i try just (1) and (2), it still doesnt sort:
$ cat f | sort -t% -k2 -k4
/path/._cfg0000_asciidoc.conf%/path/%._cfg0000_%asciidoc.conf
/path/._cfg0000_docbook.conf%/path/%._cfg0000_%docbook.conf
/path/._cfg0001_asciidoc.conf%/path/%._cfg0001_%asciidoc.conf

if however i cut out field 3, then it seems to sort properly:
$ cat f | cut -d% -f1,2,4 | sort -t% -k2 -k3
/path/._cfg0000_asciidoc.conf%/path/%asciidoc.conf
/path/._cfg0001_asciidoc.conf%/path/%asciidoc.conf
/path/._cfg0000_docbook.conf%/path/%docbook.conf

using coreutils 7.4 here, and locale doesnt seem to matter (forcing to C gets 
same result).  there are no custom patches to the source in Gentoo.
-mike



_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to