如何在powershell中运行cygwin脚本

Apo*_*orv 8 shell powershell cygwin

我正在尝试在 powershell 中运行 cygwin 脚本。我怎样才能做到这一点?

我尝试给出脚本的完整路径,后跟 args 。它不起作用示例:/c/script/path/script args

Ans*_*ers 6

使用/cygdrive/c/script/path/scriptor C:/script/path/script(注意后一个路径中的大写字母C和缺少前导斜杠)。另外,需要使用正确的解释器运行脚本,例如:

& C:\cygwin\bin\bash.exe /cygdrive/c/script/path/script ...
Run Code Online (Sandbox Code Playgroud)