shell expansion produces e.g. "ls: cannot access '*.pdf': No such file or directory" in Windows CMD shell, but works okay in bash

Andrey Repin anrdaemon@yandex.ru
Mon Mar 23 19:13:00 GMT 2020


Greetings, Jay Libove!

> Hi Andrey,
> (I have no idea what you mean about "top posting".)

https://cygwin.com/acronyms/#TOFU

> `locale` gives the same in CMD as in bash, on this machine as on another
> machine on my network where I also checked, which also exhibits the same
> globbing problem under Windows CMD:

> LANG=
> LC_CTYPE="C.UTF-8"
> LC_NUMERIC="C.UTF-8"
> LC_TIME="C.UTF-8"
> LC_COLLATE="C.UTF-8"
> LC_MONETARY="C.UTF-8"
> LC_MESSAGES="C.UTF-8"
> LC_ALL=

> Aha, wait! No, there is one difference: in Cygwin Terminal (which I've
> never run before today; I've always either just run commands in a CMD
> window, or run bash.exe first; I'd initially mistakenly assumed that Cygwin
> terminal was the same as bash-in-CMD, but clearly it's not):
> LANG=en_US.UTF-8

> If I set LANG=en_US.UTF-8 in a Windows CMD window, **then the globbing problem goes away**.

> I'm not sure how that points towards a solution, but it certainly must be a clue.

I have LANG=ru_RU.UTF-8 set in the user environment, but i have an autostart
script for cmd.exe to set LANG=ru_RU.CP866 when I want to work in plain
command prompt. But then again, I have code in ~/.bashrc which would

1. chcp 65001
2. export "LANG=$(locale -uU)"

which helps transitioning from native applications to (saner) Cygwin environment.


-- 
With best regards,
Andrey Repin
Monday, March 23, 2020 22:02:08

Sorry for my terrible english...




More information about the Cygwin mailing list