Greetings, Christian Franke!

> Andrey Repin wrote:
>> Greetings, Christian Franke!
>>
>> ...
>>> Unfortunately the ipconfig output is always localized, so this does only
>>> work OOTB with English versions of Windows. The ipconfig parsing is also 
>>> broken due to two reasons:
>>> - The current Cygwin versions of awk, grep and sed no longer convert CR/LF
>>> -> LF on stdin, so '/FooBar$/' patterns never match.
>>> - ipconfig may output scoped IPv6 addresses ("fe80::1%12") which are not 
>>> matched by the awk script.
>>> A draft patch is attached. It also avoids the tmp file and uses shell 
>>> builtins where possible.
>> Why not use netsh with `chcp 65001`?

> How would netsh help?

> Netsh is also localized and changing the codepage does possibly not change
> the output language. Changing the language would also require
> '.../en-US/netsh.exe.mui' file which is not necessarily installed.

netsh with console CP set to 65001 switching to English.

> If netsh is run interactively, it prints a deprecation warning for
> 'interface' and other commands and recommends usage of powershell.

You are not going to run it interactively, so not really a problem.
And netsh output is much more parsing friendly.


-- 
With best regards,
Andrey Repin
Friday, August 19, 2022 12:11:11

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