相关疑难解决方法(0)

GNU 并行 vs &(我的意思是背景) vs xargs -P

我对.sh使用脚本在脚本中运行一组任务的区别或优势(如果有的话)感到困惑GNU parallel

例如Ole Tange的回答:

parallel ./pngout -s0 {} R{} ::: *.png
Run Code Online (Sandbox Code Playgroud)

而不是说通过它们循环将它们放在背景中&

例如froschutz的回答:

#copied from the link for illustration
for stuff in things
do
( something
  with
  stuff ) &
done
wait # for all the something with stuff
Run Code Online (Sandbox Code Playgroud)

简而言之,它们只是在语法上或实际上不同吗?如果实际上不同,我应该什么时候使用它们?

xargs shell-script background-process gnu-parallel

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