0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

WSL2からWindows側のNICのIPアドレスを取得したいな

Posted at

VSCodeならhost.docker.internal:host-gatewayで済むけどPHPStormなので

ありがたい記事

こちらを参考にしたものの、どうもうまく動かないのでいろいろ試した。

原因

grepすると「バイナリファイル (標準入力) に一致しました」と言われる

-aオプションをつけて、強制的にテキストでの入力とみなす必要がある

でした。

結果

ipconfig.exe | sed -e 's/\r//' | grep -a 'IPv4' | grep -a '192.168.' | awk -F': ' '{print $2}'
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?