Greetings, Mark Liam Brown!

> I am trying to parse the output of "net use" in a bash script, but hit
> a roadblock:
> The output of "net use" changes with the language of the system
> (English, Danish, French, ...), so parsing becomes nearly impossible

> How can I force the language used by "net use" to English, even if the
> system default language is Danish or French?

chcp 65001

Make a symlink to chcp.com from /usr/local/bin/chcp for easier access.
Forcing unicode console CP makes many system programs (netsh, net, route,
ipconfig of what I tried) switch to what appears to be an equivalent of
C.UTF-8 locale, making their output consistent across different OS
localizations.

But frankly, if you really need automation in windows, PowerShell if here
to help. You would be able to do everything in a single, reasonable portable
script, and not need to involve Cygwin at all.


-- 
With best regards,
Andrey Repin
Monday, July 22, 2024 00:01:16

Sorry for my terrible english...


-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to