如何在Linux中从PowerShell内核执行Bash脚本
我有一个bash脚本如何在Linux中从PowerShell内核执行Bash脚本,bash,powershell,shell,powershell-core,Bash,Powershell,Shell,Powershell Core,我有一个bash脚本foo.sh,我想用PowerShell Core中的一些参数--bar执行它。这不起作用: ./foo.sh 使用&运算符 & "./foo.sh" 或者使用bash执行它 & bash "./foo.sh" 事实证明,您也可以只执行/foo.sh。使用和“/foo.sh”或/foo.sh只需在我的系统的文本编辑器中打开foo.sh即可。要实际运行脚本,我必须使用:&bash./foo.sh“
foo.sh
,我想用PowerShell Core中的一些参数--bar
执行它。这不起作用:
./foo.sh
使用&运算符
& "./foo.sh"
或者使用bash执行它
& bash "./foo.sh"
事实证明,您也可以只执行
/foo.sh
。使用和“/foo.sh”
或/foo.sh
只需在我的系统的文本编辑器中打开foo.sh即可。要实际运行脚本,我必须使用:&bash./foo.sh“