file globbing in now case insensitive?

Joel Rees joel.rees at gmail.com
Sun Apr 2 23:53:30 UTC 2017


On Mon, Apr 3, 2017 at 2:09 AM, Ralf Mardorf <silver.bullet at zoho.com> wrote:
> On Sun, 2 Apr 2017 17:29:35 +0100, Colin Watson wrote:
>>Or just export LC_COLLATE=C.UTF-8.
>
> You not necessarily need to export it. However, this works for Ubuntu...
>
> [root at moonstudio tmp]# grep PRETTY /etc/os-release
> PRETTY_NAME="Ubuntu 16.04.2 LTS"
> [root at moonstudio tmp]# locale -a | grep C
> C
> C.UTF-8
> [root at moonstudio tmp]# ls
> A  b
> [root at moonstudio tmp]# LC_COLLATE=C echo [A-Z]*
> A
> [root at moonstudio tmp]# LC_COLLATE=C.UTF-8 echo [A-Z]*
> A
>
> ...but isn't portable. On Arch Linux...
>
> [root at archlinux test]# grep PRETTY /etc/os-release
> PRETTY_NAME="Arch Linux"
> [root at archlinux test]# locale -a | grep C
> C
> [root at archlinux test]# ls
> A  b
> [root at archlinux test]# LC_COLLATE=C echo [A-Z]*

... but, what about "LC_COLLATE=C.UTF-8" on arclinux?

(Is default C locale different from UTF-8 C locale on archlinux,
perhaps? (Actually, I'd kind of hope not.)

And I guess the locale for globbing would sort of make sense if the
range [A-z] proves to be equivalent to [:alpha:].

> A b
>
> ...it doesn't work. So if the OP should need it for command line on
> Ubuntu only, it's ok, but for a portable script it might not do the job.
>
> Regards,
> Ralf



-- 
Joel Rees

I'm imagining I'm a novelist:
http://joel-rees-economics.blogspot.com/2017/01/soc500-00-00-toc.html
More of my delusions:
http://reiisi.blogspot.jp/p/novels-i-am-writing.html




More information about the ubuntu-users mailing list