小编hit*_*esh的帖子

在 bash 脚本中运行 powershell 脚本

在 Powershell 中 -
如何在 bash 脚本(.sh)中运行 powershell 脚本(.ps1)
我可以只运行 powershell 脚本
- & .\scriptfile.ps1
和 bash 脚本。
但是当我尝试在 bash 脚本中运行 powershell 时,我得到
file.ps1 : command not found
两个脚本都在同一路径中。

bash powershell

1
推荐指数
2
解决办法
5606
查看次数

突破bash的嵌套循环

您如何摆脱bash的嵌套循环?

尝试continuebreakbreak工作了。但想了解更多。

for i in 1 2 3; do 
  if [[ $flag -eq 1 ]]; then
    break
  fi
done
Run Code Online (Sandbox Code Playgroud)

break实际上如何知道循环是嵌套的?除了break,我可以使用i=4或超出范围的内容退出循环。

bash

0
推荐指数
1
解决办法
49
查看次数

标签 统计

bash ×2

powershell ×1