Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 09 Apr 2017 13:31:48 -0300
From:      =?UTF-8?Q?Nilton_Jos=C3=A9_Rizzo?= <rizzo@i805.com.br>
To:        Andrey Chernov <ache@freebsd.org>
Cc:        Toomas Soome <tsoome@me.com>, Allan Jude <allanjude@freebsd.org>, FreeBSD Current <freebsd-current@freebsd.org>, owner-freebsd-current@freebsd.org
Subject:   Re: problem with ls, not show a correct list
Message-ID:  <fbf7ae99e80117f1224f4da84cd341f0@i805.com.br>
In-Reply-To: <f36a1aca-fcc0-1486-986a-279155a850f7@freebsd.org>
References:  <fe2da09242ff63acb0c62dd0519cfa1f@i805.com.br> <25969d2c-6857-77a4-86a4-08b22f15cbfe@freebsd.org> <c0b1548a69d63a72ea73a299e55a0be9@i805.com.br> <7a08478e-ee7c-70f6-1b52-bb966f47c594@freebsd.org> <A332BA67-E71E-4CDF-AB98-241A802F8EFA@me.com> <1ba4fb7aa090271be631f01e9f72d844@i805.com.br> <f36a1aca-fcc0-1486-986a-279155a850f7@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Em 2017-04-09 00:26, Andrey Chernov escreveu:
> On 07.04.2017 23:20, Nilton José Rizzo wrote:
>> Em 2017-04-07 05:51, Toomas Soome escreveu:
>>>> On 7. apr 2017, at 11:29, Andrey Chernov <ache@freebsd.org> wrote:
>>>> 
>>>>>  Hi Allan, the ls show all files without case match
>>>>> 
>>>>> ls [a-z]*
>>>>> 
>>>>> show all files beginning with a and A  like this [aA-zZ]*
>>>> 
>>>> No, last "Z" is not included.
>> 
>> 
>>    Look this, it's a great error!!!!
> 
> I see no error. You do not include Z into [a-z] expression above, so 
> why
> you expect it is unknown.
> 
>> I lower- equal a upper-case why Z not show in this list?
> 
> No, it is not case-equal sorting. As I already mention, it is
> dictionaries sorting, letters considered first, their case - next (and
> maybe many other factors for non-ASCII - next).
> 
>> image when a admin use like thinks some rm -rf /*/[A-Z]*
> 
> Admin should either run C or US-ASCII locale or do not use a-z ranges
> without knowing sorting on his locale.
> 
> I see no errors in your sh examples.

    try this

         ls [a-b,k-m]

    in sh using the locale setting to pt_BR.UTF-8

      it's not work


# locale
LANG=pt_BR.UTF-8
LC_CTYPE="pt_BR.UTF-8"
LC_COLLATE="pt_BR.UTF-8"
LC_TIME="pt_BR.UTF-8"
LC_NUMERIC="pt_BR.UTF-8"
LC_MONETARY="pt_BR.UTF-8"
LC_MESSAGES="pt_BR.UTF-8"
LC_ALL=
# ls [[:lower:]][a-c,k-m]*
aa
# ls
a       b       d       f       j       m       p       t       x
A       B       D       g       k       M       q       u       y
aa      c       e       h       K       n       r       v       z
Aa      C       E       i       l       o       s       w       Z
#


     It's not show the correct list, this commant MUST BE SHOW like a C 
locale



# locale
LANG=C
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=
# ls [a-c,k-m]*
a       aa      b       c       k       l       m
# ls [[:lower:]][a-c,k-m]*
aa
#

   When I try to use the poor workaround [[:lower:]] or [[:upper:]]
this have too different behavior.  The list replacement not work 
properly


    Note, I know that Unicode have some differents, but when tha basic 
list replacement
and other basic default behavior must be preserved.



> 
> In general it was decided (not by me) to use CLDR collation since it is
> able to stable sort all Unicode chars.
> 

   It's a great problema yes!, the default shell in FreeBSD to user root
in fresh new installation is csh, look the passwd file

root:*:0:0::0:0:Charlie &:/root:/bin/csh

    and it's will be great problem because all man pages with
trate a list substitution not say anything about this.



> 
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to 
> "freebsd-current-unsubscribe@freebsd.org"

-- 
********************************************************
* Nilton José Rizzo     Sistema de Informação    UFRRJ *
* http://cursos.ufrrj.br/grad/sistemas/                *
* lattes:http://lattes.cnpq.br/0079460703536198        *
********************************************************



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?fbf7ae99e80117f1224f4da84cd341f0>