traveh Asked: 2023-04-24 15:22:58 +0800 CST 同时在子目录中运行命令 10 我知道如何在所有匹配这样的模式的子目录中运行命令(假设我想运行gh repo sync): for d in ./*/ ; do (cd "$d" && gh repo sync) ; done 并在每个目录的子 shell 中连续运行命令。 我想要的是并行运行所有命令,但在主脚本中等待它们全部完成。 我正在使用 Ubuntu 22.04。那可能吗? shell-script