跳至主要内容

博文

目前显示的是 二月, 2022的博文

Create Symbolic Link using PowerShell

类似于 Linux 的 `ln -s` 命令,Windows PowerShell 也支持在文件系统中创建 SymbolicLink。 例如,为了方便在 Visual Studio Code中预览 Markdown 的图片,就可以建立软链接: ```PowerShell cd src\main New-Item -Path .\markdown\frontend\img \ -ItemType SymbolicLink \ -Value .\resources\frontend\images\ ```

WSL invalid option when executing shell script

有一个 bash script,在MacOS里执行的顺利无比,但是一到 WSL 里头就总是出问题。 : invalid option 一开始怀疑是 shebang 哪里写错了,后来发现不对,貌似和 '^M' 有关。最后在[这里](https://newbedev.com/bad-interpreter-bin-bash-m-code-example)看到了类似的提示,果然是linefeed要替换! sed -i -e 's/\r$//' $FILE.sh