bash - 等待命令使用什么进程来确定完成了哪个进程?
问题描述
我在 shell 脚本中有一个 for 循环,运行如下:
for ((i=1; i<=N; i++))
do
eval $cmd
wait
done
我的问题是 $cmd 的形式是:
numactl --physcpu=0-0 --membind=0 [SCRIPT] &
numactl --physcpu=1-1 --membind=0 [SCRIPT] &
numactl --physcpu=2-2 --membind=0 [SCRIPT] &
...
numactl --physcpu=20-20 --membind=0 [SCRIPT]
WAIT 命令等待完成以下哪些进程?都是他们吗?如果不是,我应该如何去做,以便 forloop 的每次迭代只在所有 20 个 SCRIPT 实例完成后运行?
解决方案
推荐阅读
- asp.net - 什么是 .NetCore 分析器
- javascript - Mongoose 具有相同的保存和更新中间件功能
- flutter - 如何从 Flutter Firestore 中的嵌套集合中获取数据?
- xamarin - 在请求位置许可时,应用程序仅在 iOS 中崩溃。在 xamarin
- node.js - 使用nodejs驱动程序在mongodb中的dd.mm.yyyy中的日期格式
- c# - 处理所有子控件和数据 - C#
- c# - 更新父实体而不更改子实体
- spring-mvc - 异常:com.fasterxml.jackson.core.JsonParseException:无法识别的令牌“代码”:期待(“真”、“假”或“空”)
- python - 如何检查列表中的数字是否小于列表中的另一个数字
- web-services - 无法添加托管在 azure 中的 WCF 服务