Comments (6)
你说的应该是 wsl2.ps1
这个文件里的,因为 powershell 脚本在执行的时候会转义 $
这个字符 所以 `$ 可以让 $ 不被转义。
在 bash 中直接执行 ip route | grep default | awk '{print $3}'
即可
from dotfiles.
直接执行脚本也需要这么改呀,,,
from dotfiles.
哈哈 我这里是通过 pwsh 里调用 bash.exe -c {语句}
所以要让这里的 {语句}
里的内容都转义正确
from dotfiles.
貌似我又发现一个神奇的问题,wsl.local在宿主只能ping通,这功能我是想着转发kubernetes dashboard,然后:
fa@FAWDLSTTY-PC:/mnt/c/Users/fawdlstty$ minikube dashboard
🤔 Verifying dashboard health ...
🚀 Launching proxy ...
🤔 Verifying proxy health ...
🎉 Opening http://127.0.0.1:43909/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/ in your default browser...
👉 http://127.0.0.1:43909/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/
我将这个地址换成wsl.local访问不了,ip也不行,但wsl2内能访问。是否还缺一个设置?
from dotfiles.
wsl2 能访问是因为它会向主机查询 dns(因为 nameserver 指向了 windows 主机),主机会把 hosts 中的域名直接缓存起来然后直接作为一个 dns 记录。
docker 可能不走这个设置,可能需要手动设置一下 dns 的地址为主机(我没试过)....
from dotfiles.
谢谢,我再看看
from dotfiles.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotfiles.