在 Powershell 中 -
如何在 bash 脚本(.sh)中运行 powershell 脚本(.ps1)
我可以只运行 powershell 脚本
- & .\scriptfile.ps1
和 bash 脚本。
但是当我尝试在 bash 脚本中运行 powershell 时,我得到
file.ps1 : command not found
两个脚本都在同一路径中。
您如何摆脱bash的嵌套循环?
尝试continue和break。break工作了。但想了解更多。
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或超出范围的内容退出循环。