[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ls -v is still inconsistent
From: |
Jim Meyering |
Subject: |
Re: ls -v is still inconsistent |
Date: |
Fri, 20 Mar 2009 12:19:14 +0100 |
Kamil Dudka wrote:
> On Thursday 19 March 2009 11:27:11 Sven Joachim wrote:
>> While the ordering of hidden files in "ls -v" seems to be fixed
>> now, there are still inconsistencies. Here's what I get in the latest
>> snapshot:
>>
>> ,----
>>
>> | LANG=C /usr/local/src/coreutils-7.1.63-8e6a6/src/ls -alv
>> | total 0
>> | drwxr-xr-x 2 sven sven 160 Mar 19 11:13 .
>> | drwxrwxrwt 9 root root 200 Mar 19 11:15 ..
>> | -rw-r--r-- 1 sven sven 0 Mar 19 11:13 a~
>> | -rw-r--r-- 1 sven sven 0 Mar 19 11:13 a
>> | -rw-r--r-- 1 sven sven 0 Mar 19 11:13 a.b
>> | -rw-r--r-- 1 sven sven 0 Mar 19 11:13 a.bc
>> | -rw-r--r-- 1 sven sven 0 Mar 19 11:13 a.b~
>> | -rw-r--r-- 1 sven sven 0 Mar 19 11:13 a.bc~
>>
>> `----
>>
>> Note that a~ sorts before a, but a.b~ after a.b.
>>
>> Regards,
>> Sven
>
>
> Thanks again! The file suffix regex doesn't match any suffix containing '~'.
>
> I've changed it this way:
> /(\.[A-Za-z][A-Za-z0-9]*)*$/
> /(\.[A-Za-z~][A-Za-z0-9~]*)*$/
>
> Now it works correctly with simple and numbered backups. Simple patch
> including clarifying test cases is attached.
Hi Kamil,
Thanks for fixing that. Perhaps "~" isn't
the only character we should treat that way.
What do you think of these?
$ printf '%s\n' a a_ a.b a.b_ a.bc a.bc_|sort -V :
a
a.b
a.bc
a.bc_
a.b_
a_
$ printf '%s\n' a a- a.b a.b- a.bc a.bc-|sort -V :
a
a.b
a.bc
a-
a.bc-
a.b-
- ls -v is still inconsistent, Sven Joachim, 2009/03/19
- Re: ls -v is still inconsistent, Kamil Dudka, 2009/03/20
- Re: ls -v is still inconsistent,
Jim Meyering <=
- Re: ls -v is still inconsistent, Bruno Haible, 2009/03/20
- Re: ls -v is still inconsistent, Kamil Dudka, 2009/03/20
- Re: ls -v is still inconsistent, Bob Proulx, 2009/03/20
- Re: ls -v is still inconsistent, Kamil Dudka, 2009/03/20
- Re: ls -v is still inconsistent, Kamil Dudka, 2009/03/23
- Re: ls -v is still inconsistent, Bob Proulx, 2009/03/23
- Re: ls -v is still inconsistent, Jim Meyering, 2009/03/24