Re: Does sort handle -t / correctly

2015-04-17 Thread Eric Blake
On 04/17/2015 11:03 AM, Peng Yu wrote: On Fri, Apr 17, 2015 at 11:26 AM, Eric Blake ebl...@redhat.com wrote: On 04/17/2015 10:10 AM, Peng Yu wrote: Hi, I got the following results when I call sort with -t /. It seems that 'a/1.txt' should be right after 'a'. Is it the case? Or I am not using

Re: Does sort handle -t / correctly

2015-04-17 Thread Eric Blake
On 04/17/2015 10:10 AM, Peng Yu wrote: Hi, I got the following results when I call sort with -t /. It seems that 'a/1.txt' should be right after 'a'. Is it the case? Or I am not using sort correctly? Your assumption is correct - you are using sort incorrectly, by failing to take locales into

Re: Does sort handle -t / correctly

2015-04-17 Thread Peng Yu
On Fri, Apr 17, 2015 at 11:26 AM, Eric Blake ebl...@redhat.com wrote: On 04/17/2015 10:10 AM, Peng Yu wrote: Hi, I got the following results when I call sort with -t /. It seems that 'a/1.txt' should be right after 'a'. Is it the case? Or I am not using sort correctly? Your assumption is

Re: Does sort handle -t / correctly

2015-04-17 Thread Ray Dillinger
I have compiled my own 'sort' which deliberately ignores locale, (more precisely deliberately uses the 'C' locale by default) for exactly this reason. I don't want to screw with an environment variable that affects dozens of things just to get sort to work predictably. A while ago I offered a

Does sort handle -t / correctly

2015-04-17 Thread Peng Yu
Hi, I got the following results when I call sort with -t /. It seems that 'a/1.txt' should be right after 'a'. Is it the case? Or I am not using sort correctly? $ printf '%s\n' a 'a!' ab aB a/1.txt | sort -t / -k 1 -k 2 -k 3 -k 4 a a! a/1.txt aB ab -- Regards, Peng