据我所知,我在MSYS2 ipconfig /all
shell中一直使用bash
没问题。
但是今天,我只是发现了一些奇怪的东西。在Windows 10命令提示符(cmd.exe
)中,我可以输入:
C:\>ipconfig
Windows IP Configuration
Ethernet adapter Ethernet:
....
...或:
C:\>ipconfig /all
Windows IP Configuration
Host Name . . . . . . . . . . . . : DESKTOP-MYPC
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
Ethernet adapter Ethernet:
...
...它们都可以正常工作。
但是,当我转到MSYS2 bash
shell时,仅使用ipconfig
(或ipconfig.exe
)就可以了-但是,当我尝试添加/all
时,失败:
$ ipconfig.exe /all
Error: unrecognized or incomplete command line.
USAGE:
ipconfig [/allcompartments] [/? | /all |
...
...我觉得很奇怪。以防万一,我尝试将正斜杠加倍,然后它起作用了(?!)
$ ipconfig.exe //all
Windows IP Configuration
Host Name . . . . . . . . . . . . : DESKTOP-MYPC
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
...
现在,如果这是一个反斜杠,我会明白问题出在哪里(考虑反斜杠是bash
中的转义字符),但我真的不明白,为什么要使用正斜杠呢?翻倍,要使该命令在MSYS2中工作?!
会有人解释吗,为什么使用bash
时我会看到MSYS2 ipconfig /all
出现故障,但是如果使用ipconfig //all
却能看到故障?