When I execute a Windows command (.exe
) in a while loop of wsl2, the display is corrupted.
$ seq 10 | while read i; do ipconfig.exe &>/dev/null; echo $i; done
1
I can't get the expected result.
The same applies to commands of .exe
other than ʻipconfig.exe`.
wsl1 does not have this problem.
(Probably) .exe
is picking up the standard input.
Add </ dev / null
to .exe
.
ipconfig.exe </dev/null
$ seq 10 | while read i; do ipconfig.exe </dev/null &>/dev/null; echo $i; done
1
2
3
4
5
6
7
8
9
10
Recommended Posts